From ca9d0c75f8de7489e67ee99025d496bf19d6feea Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 2 May 2021 09:06:48 +0100 Subject: [PATCH] proof of concept --- app/playlists.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index 98c37db..762e4a6 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -287,16 +287,18 @@ class Playlist(QTableWidget): self.id = plid Playlists.open(plid) p = Playlists.get_playlist_by_id(plid) + self.db = p + self.populate_playlist() - # We need to retrieve playlist tracks and playlist notes, then + def populate_playlist(self): # add them in row order. We don't mandate that an item will be # on its specified row, only that it will be above # larger-numbered row items, and below lower-numbered ones. data = [] - for t in p.tracks: + for t in self.db.tracks: data.append(([t.row], t.tracks)) - for n in p.notes: + for n in self.db.notes: data.append(([n.row], n)) # Clear playlist