If we have two albums by the same artist in the same year (such as a CD1
or CD2 postfix), then we'll end up mixing them together when sorting.
Fix this by changing the default sort order to
Artist -> Year -> Album -> Track Number
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than offering two init functions for testing. This lets the UI
select if they want async idle tasks (like Album Art fetching).
Implements #90: Give idle_init an async flag
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Everything has been merged into the playlist layer to better match how
playlists are actually used. This means we can remove the queue files.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I move the random variable into the playlist code since it is no longer
used by the queue layer. This gives me the opportunity to change it
into a boolean rather than a bit flag.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
In most cases this function just triggers a UI update, but system
playlists have a little extra bookkeeping to do to remove the track from
the Queued Tracks playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This replaces the "reset" field that had been passed to sort. I think
this makes things a little more straightforward, and gives us a function
we can call when freeing playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was only used by system playlists to keep the unplayed, most played,
and least played playlist up to date. We can handle this internally
through the playlist_played() handler.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is used to notify when tracks have been played so dynamic playlists
can be updated, and so the model can display the correct playcount.
The old system playlist tests are mostly unnecessary at this point, so I
remove them as part of this patch.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And stores it for future reference, so we don't have to keep looking up
current and previous playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is much more straightforward than converting an id to a name and
then looking up playlists from there. This patch removes the now-unused
playlist_get_name() function.
This patch also lets me simplify the system playlist unit test, since I
can now check several similar operations using a loop. Additionally, I
change calls to pl_system_lookup() into pl_system_get() for efficiency.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I think "lookup" is a better name for this function, since it's similar
to performing a dictionary lookup.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Additionally, it also uses a playlist-level function pointer to decide
what to do. In most cases this calls the generic sort function, but the
history playlist should never be sorted.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Additionally, playlist_set_random() uses a playlist-level function
pointer to decide what to do. In most cases this will simply toggle the
flag, but the history playlist does not support random playback.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through playlist-type operations. Additionally, I
take this opportunity to change playlist_remove() to take a playlist
struct directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through playlist-type operations. Additionally, I
take this opportunity to change playlist_add() to take a playlist struct
directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through the playlist-type operations. Additionally, I
take this opportunity to change playlist_delete() to take a playlist
struct directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is much more useful than a boolean status, since we can use the
playlist pointer right away.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I query the underlying playlist to see if it is selectable, and then
update the settings file if it is.
Implements #10: Select default playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I need to have integer playlist ids to store into the settings database
once I allow changing the default playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
System playlists cannot be created or deleted, so these functions simply
return false in this case. Library playlists will use this to add new
library paths to Ocarina.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also take the opportunity to add in a generic lookup function to
convert a library path into a playlist.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function is for both adding and removing tracks, and only returns
false. Tracks will only be added and removed through the update
function.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The pl_library_init() function is used to allocate a playlist for each
library path already in the database, and pl_library_deinit() is then
used to free this memory during cleanup.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>