[library] Some refactoring of the library module

Misc refactoring, e.g. alignment of how modules save tracks and playlists, incl
use of mfi and pli. Also try to avoid direct calls between library and player.
This commit is contained in:
ejurgensen
2020-01-20 14:13:47 -08:00
parent 08e89ffd4f
commit abdc0d6d27
7 changed files with 399 additions and 340 deletions

View File

@@ -2182,6 +2182,7 @@ queue_tracks_add_playlist(const char *id, int pos)
static int
queue_tracks_add_byuris(const char *param, int pos, int *total_count)
{
struct player_status status;
char *uris;
char *uri;
char *ptr;
@@ -2227,7 +2228,9 @@ queue_tracks_add_byuris(const char *param, int pos, int *total_count)
}
else
{
ret = library_queue_add(uri, pos, &count, NULL);
player_get_status(&status);
ret = library_queue_item_add(uri, pos, status.shuffle, status.item_id, &count, NULL);
if (ret != LIBRARY_OK)
{
DPRINTF(E_LOG, L_WEB, "Invalid uri '%s'\n", uri);