mirror of
https://github.com/owntone/owntone-server.git
synced 2025-12-01 13:52:37 -05:00
[library] Add function to delete playlist by id that directly
invalidates the REST API client caches
This commit is contained in:
@@ -742,6 +742,25 @@ library_playlist_remove(char *virtual_path)
|
||||
return commands_exec_sync(cmdbase, playlist_remove, NULL, virtual_path);
|
||||
}
|
||||
|
||||
int
|
||||
library_playlist_remove_byid(int pl_id)
|
||||
{
|
||||
if (scanning)
|
||||
{
|
||||
DPRINTF(E_INFO, L_LIB, "Scan already running, ignoring request to remove playlist '%d'\n", pl_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
db_pl_delete(pl_id);
|
||||
|
||||
if (handle_deferred_update_notifications())
|
||||
listener_notify(LISTENER_UPDATE | LISTENER_DATABASE);
|
||||
else
|
||||
listener_notify(LISTENER_UPDATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
library_queue_save(char *path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user