playlist: Remove playlist_add()

It was only used in filetree.c. It's still implemented in Lua so
scripts using rb.playlist_add() won't break, but has been removed
from the Lua API "backend".

Change-Id: I5625a47f0692456008c6b10dee14755151d22f29
This commit is contained in:
Aidan MacDonald 2023-03-29 09:24:29 +01:00 committed by Solomon Peachy
parent 129fb4016b
commit 9ba51e3552
8 changed files with 14 additions and 28 deletions

View file

@ -74,6 +74,7 @@ int ft_build_playlist(struct tree_context* c, int start_index)
int i;
int res = 0;
int start=start_index;
struct playlist_info *playlist = playlist_get_current();
tree_lock_cache(c);
struct entry *entries = tree_get_entries(c);
@ -82,7 +83,8 @@ int ft_build_playlist(struct tree_context* c, int start_index)
{
if((entries[i].attr & FILE_ATTR_MASK) == FILE_ATTR_AUDIO)
{
res = playlist_add(entries[i].name);
res = playlist_insert_track(playlist, entries[i].name,
PLAYLIST_INSERT_LAST, false, false);
if (res < 0)
break;
}
@ -127,10 +129,9 @@ bool ft_play_playlist(char* pathname, char* dirname,
if (playlist_create(dirname, filename) != -1)
{
if (global_settings.playlist_shuffle)
{
playlist_shuffle(current_tick, -1);
}
playlist_set_modified(NULL, false);
playlist_start(0, 0, 0);
return true;
}
@ -528,6 +529,7 @@ int ft_enter(struct tree_context* c)
start_index = 0;
}
playlist_set_modified(NULL, false);
playlist_start(start_index, 0, 0);
play = true;
}