I bump the user_version to 3 at the same time. This table will be used
to hold listenbrainz listens that have not yet been submitted to the
listenbrainz server. I also give the Track table functions to get and
delete listens from this table as needed by the listenbrainz thread.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I haven't run tests in the evening in a long time, so I never noticed
these failures due to sqlite returning utc timestamps when we expect
localtime.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I found that deleted and restorted tracks were incorrectly showing up in
the "New Tracks" playlist. I can fix this by saving the track added date
when the tracks is deleted. The only thing I can't do easily is get the
added date for tracks that have already been deleted, so I set this to
the date of the database upgrade.
Fixes: #64 ("Save the tracks.added date when deleting")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Leaving the database in a dirty state could cause unintentional data
loss if the app crashes.
Fixes: #63 ("The database isn't being committed enough")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I expand on the genres_view to include additional playlist properties,
and configure the default sort order to sort by artist, album, and track
number.
I then configure the Genres table to use the system_tracks table to
manage each genre's associated tracks and set up the genre_tracks_view
to make it easy for Tracks to find their Genres.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I expand on the artists_view to include additional playlist properties,
and configure the default sort_order to sort albums in an intuitive way.
I then configure the Artists table to us the system_tracks table to
manage each artist's associated tracks and set up the artist_tracks_view
to make it easy for Tracks to find their Artists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The TrackidSet is intened to be used by Playlists to keep track of which
Tracks have been added without much overhead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This includes the favorite status, playcount, last played timestamp, and
last started timestamp. These values will be restored if a Track with
the same mbid is created at a later time.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This patch adds extra handling for changing the value of the
Track:favorite property, if the Track is the current track. This lets us
have the Now Playing card bind to the current-favorite property to
update the UI (and have the UI update the Track).
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Tracks now have start(), stop(), and restart() functions that can be
used by the application to update the laststarted, lastplayed,
playcount, active, and restarted properties.
The track Table implements their half of these functions in addition to
a mark_path_active() function so opening Emmental with a filepath can
update the current track before the database is loaded. The Table also
adjusts the necessary system playlists when tracks are marked as played.
Finally, the Table now has have-current-track and current-track
properties that can be wired up to the Now Playing card.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Track Table does all the work for saving, loading, and managing
Track objects. I also create a SQLite View to link tracks to their
associated artists, albums, and mediums.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Track object represents a single track in the Library along with all
their corresponding metadata.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>