Anna Schumaker
853594fc26
db: Remove indexes
...
They aren't doing anything useful to help speed up sorting, so remove
for now and reevaluate later
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 22:05:42 -05:00
Anna Schumaker
2e57e1fe0a
db: Preserve the current track when removing tracks
...
Again, we have to be careful not to check positions against playlists
where current == -1 for performance reasons.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker
0c3afb9d56
db: Give playlists a remove_track() function
...
And emit a "track-removed" signal to notify the higher layers.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-27 11:25:04 -04:00
Anna Schumaker
9b4153737b
db: Give playlists an add_track() function
...
And emit a "track-added" signal to notify higher layers
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-27 11:25:02 -04:00
Anna Schumaker
32dcd83865
db: Give Tracks a Decade property and genres() function
...
For accessing a Track's Decade playlist or list of genres
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-27 11:25:02 -04:00
Anna Schumaker
5ff03cf33f
db: Give MappedPlaylists add_track() and remove_track() functions
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-18 15:50:07 -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
44a002ecac
db: Convert the DiscTable into a playlist.ChildModel
...
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 17:02:04 -04:00
Anna Schumaker
a1f54839bb
db: Convert the AlbumTable into a playlist.ChildModel
...
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
0728579cc4
db: Convert the ArtistTable into a playlist.Model
...
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
4141ca211c
db: Convert the YearTable into a playlist.ChildModel
...
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
8365afc0e3
db: Convert the DecadeTable into a playlist.Model
...
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
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
a4fbd5f2f3
db: Rename playlist.py -> user.py
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:43 -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
f14d73ce67
tagdb: Mark tracks as played using datetime.datetime.now()
...
So that we caputere the timestamp that the track finished at. I also
update tha sqlite importer code to account for the possibility of
receiving either a datetime.date or a datetime.datetime
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-01 11:16:02 -04:00
Anna Schumaker
ad9cf2b135
db: Store lastplayed as a timestamp
...
Instead of just a date object.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:47 -04:00
Anna Schumaker
0e55bb25e9
db: Give Tracks a way to directly set playcount and lastplayed
...
This will be needed when importing tracks from the tagdb into the sqlite
db
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-25 13:27:54 -04:00
Anna Schumaker
3fb6f3a2ba
db: Track.path should return a Pathlib.Path
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-24 17:05:26 -04:00
Anna Schumaker
952d70c282
db: Have Tracks remove themselves from Playlist Maps when deleted
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:17:46 -04:00
Anna Schumaker
69f5742867
db: Have Tracks remove themselves from the GenreMap when deleted
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:16:51 -04:00
Anna Schumaker
ea555a428c
db: Create a TrackTable and Track object
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:15:44 -04:00