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 flag was only used by the History playlist, but we have a noop
function to handle this instead.
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>
Track database defragmenting can happen before the new tasks are ever
scheduled, causing a crash when we try to find tracks with changed IDs.
After the crash, the Favorites and Hidden playlist data appears to be
lost.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We need to free the playlist name after looking up in case we hit the
case where the playlist isn't found.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This playlist has been the same as the hidden playlist for several
releases now. Let's make the change official!
Implements #28: Save hidden playlist as "hidden" instead of "banned"
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than waiting for them to load with an idle task. This speeds up
Ocarina startup dramatically, since playlists can be added to the UI
with the correct size instead of needing extra callbacks to update the
size each time a track is added.
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>
This lets me "pause" playing queued tracks in favor of other playlists.
I remember the previous playlist so we can resume track picking once the
queued tracks playlist is empty.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was used to enable and disable library paths in previous Ocarina
versions. This isn't used anymore now that we have library-based
playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The track tag doesn't need these tags now that they can be found in the
album tag.
Implements #64: Remove Artist and Genre pointers from Tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is needed to handle track database defragmentation, but could also
be expanded on later to save playlists from a generic place.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This prevents double-saves in both the playlist entrance function and in
the overridden function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function loads playlist information from a single file, falling
back to multi-file loading if playlist.system doesn't exist yet.
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>
Right now tracks are picked from this playlist whenever possible. A
system for selecting the default playlist will be added shortly.
Implements #20: Only one queue for "Up Next"
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>