Commit Graph

11 Commits

Author SHA1 Message Date
Anna Schumaker 01de88f474 db: Give playlists a refresh() function
The Collection playlist uses this to emit the "refreshed" signal to
notify higher layers that the contents of the playlist has changed.
Eventually, this will also be used to update playlists when sorting.

Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-27 11:25:05 -04:00
Anna Schumaker 6f9fb34792 db: Give playlists a delete() function
So we can remove playlists from the database when needed.

Implemets: Issue #29 (Give playlists a delete() function)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-16 17:37:23 -04:00
Anna Schumaker 2aad28f708 db: Give Playlists an "icon-name" property
This will be used by the sidebar to display playlist rows

Implements: Issue #20 (Give Playlist database items a icon-name property)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:11:34 -04:00
Anna Schumaker 063b93b66f db: Convert the TrackTable into a table.Table
Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:09:59 -04:00
Anna Schumaker e6a65f8fe3 db: Convert the LibraryTable into a table.Model
I actually turn it into a playlist.Model, which is a table.Model that
handles playlist states for us.

Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 84ad195716 db: Convert the PlaylistStateTable into a table.Table
This gives us access to the new functions and built-in caching. I also
change the PlaylistState object to cache its values rather than querying
the database for everything.

Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 9cf1df7c33 db: Move SQLite Connection stuff into a new file
I find this cleaner than importing from the toplevel module

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-07 13:58:09 -04:00
Anna Schumaker 7dd3ff8473 db: Give Tables a get_all() function
Right now I only implement it for Libraries. More tables can be added as
needed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 14:18:06 -04:00
Anna Schumaker 6fbc5e0b27 db: Give Libraries a PlaylistState property
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:18:29 -04:00
Anna Schumaker 5a52bdc546 db: Give Libraries a way to list their Tracks
And make sure the tracks are deleted when a Library is deleted.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:15:45 -04:00
Anna Schumaker f519830095 db: Create a LibraryTable and Library object
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:15:20 -04:00