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>
Allowing us to access the playlist directly, rather than going through
the playlist-type interface.
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>
This is useful for user playlists so they can store their playlist-id
directly, letting us remove the entire playlist_get_id() function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is called to get the requested playlist. I also reworked
playlist_get_queue() to call this function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This makes file versioning way easier, since every file will have the
same version. I'll still need to manage minimum-supported versions, but
that shouldn't be too difficult going forward.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>