Commit Graph

6 Commits

Author SHA1 Message Date
Anna Schumaker ee6bf059c1 db: Replace years.year with albums.release in the default sort order
And remove the INNER JOIN with the years table since it is no longer
needed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker f82e299736 db: Add tracks.trackid ASC as a fallback sort option
This keeps us from ever completely clearing the sort field in the
playlist state, since that would lead to an incomplete SQL query error.

Fixes: #38 (PlaylistStates should not allow completely clearing sort)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker 0851aeb0cf db: Give playlists a default sort order
Most playlists sort by artist -> album -> year -> discno -> trackno, but
the Previous playlist sorts by rowid with the most recently added
tracks first, and the Up Next playlist sorts by rowid with the most
recently added tracks last.

Implements: Issue #13 (Give most playlists a default sort order)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-18 15:50:07 -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 38861bbabf db: Create a PlaylistStateTable and PlaylistState object
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:18:24 -04:00