Commit Graph

18 Commits

Author SHA1 Message Date
Anna Schumaker 0b818bc067 db: Attach release information to albums
This lets us sort albums by original release date, so if an artist
releases multiple albums in a year we can sort by month too.
Additionally, this helps us better handle albums with the same name that
were released in different years.

Implements: #40 (Store the full date in the year table)
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 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 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 67238ed385 db: Give Albums a find_disc() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 17:03:19 -04:00
Anna Schumaker 737d135d41 db: Give Artists a find_album() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -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 90c6593921 db: Give Decades a find_year() function
And adjust the Year table and Track table to take a Decade as an
argument.

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 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