summaryrefslogtreecommitdiff
path: root/apps/playlist_catalog.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist_catalog.c')
-rw-r--r--apps/playlist_catalog.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index c3cbc93a20..b6939208ac 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -389,9 +389,12 @@ bool catalog_view_playlists(void)
389 return (display_playlists(NULL, CATBROWSE_CATVIEW) >= 0); 389 return (display_playlists(NULL, CATBROWSE_CATVIEW) >= 0);
390} 390}
391 391
392static int (*ctx_add_to_playlist)(const char* playlist, bool new_playlist);
392bool catalog_add_to_a_playlist(const char* sel, int sel_attr, 393bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
393 bool new_playlist, char *m3u8name) 394 bool new_playlist, char *m3u8name,
395 void (*add_to_pl_cb))
394{ 396{
397 int result;
395 char playlist[MAX_PATH + 7]; /* room for /.m3u8\0*/ 398 char playlist[MAX_PATH + 7]; /* room for /.m3u8\0*/
396 if ((browser_status & CATBROWSE_PLAYLIST) == CATBROWSE_PLAYLIST) 399 if ((browser_status & CATBROWSE_PLAYLIST) == CATBROWSE_PLAYLIST)
397 return false; 400 return false;
@@ -437,8 +440,13 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
437 return false; 440 return false;
438 } 441 }
439 442
440 if (add_to_playlist(playlist, new_playlist, sel, sel_attr) == 0) 443 if (add_to_pl_cb != NULL)
441 return true; 444 {
445 ctx_add_to_playlist = add_to_pl_cb;
446 result = ctx_add_to_playlist(playlist, new_playlist);
447 }
442 else 448 else
443 return false; 449 result = add_to_playlist(playlist, new_playlist, sel, sel_attr);
450
451 return (result == 0);
444} 452}