From 9ba51e355287f234260977e8cd978773e2528cae Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 29 Mar 2023 09:24:29 +0100 Subject: 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 --- apps/plugins/lua/include_lua/playlist.lua | 2 +- apps/plugins/lua/rocklib.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/lua/include_lua/playlist.lua b/apps/plugins/lua/include_lua/playlist.lua index e11b30fe7d..dfa839aab1 100644 --- a/apps/plugins/lua/include_lua/playlist.lua +++ b/apps/plugins/lua/include_lua/playlist.lua @@ -28,7 +28,7 @@ rb.playlist_amount = function() return rb.playlist("amount") end rb.playlist_add = function (filename) - return rb.playlist("add", filename) + return rb.playlist("insert_track", filename, rb.PLAYLIST_INSERT_LAST, false, true) end rb.playlist_create = function(dir, filename) return rb.playlist("create", dir, filename) diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 8efaaab169..070fdb4991 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -317,13 +317,13 @@ RB_WRAP(splash_scroller) RB_WRAP(playlist) { /* just passes NULL to work with the current playlist */ - enum e_playlist {PLAYL_AMOUNT = 0, PLAYL_ADD, PLAYL_CREATE, + enum e_playlist {PLAYL_AMOUNT = 0, PLAYL_CREATE, PLAYL_START, PLAYL_RESUMETRACK, PLAYL_RESUME, PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS, PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_INSERTPLAYL, PLAYL_ECOUNT}; - const char *playlist_option[] = {"amount", "add", "create", "start", "resume_track", + const char *playlist_option[] = {"amount", "create", "start", "resume_track", "resume", "shuffle", "sync", "remove_all_tracks", "insert_track", "insert_directory", "insert_playlist", NULL}; @@ -339,10 +339,6 @@ RB_WRAP(playlist) case PLAYL_AMOUNT: result = rb->playlist_amount(); break; - case PLAYL_ADD: - filename = luaL_checkstring(L, 2); - result = rb->playlist_add(filename); - break; case PLAYL_CREATE: dir = luaL_checkstring(L, 2); filename = luaL_checkstring(L, 3); -- cgit v1.2.3