aboutsummaryrefslogtreecommitdiffstats
path: root/src/stored_playlist.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/stored_playlist.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index cb81962d1..61d4d8cc3 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -266,6 +266,21 @@ spl_clear(const char *utf8path)
}
enum playlist_result
+spl_delete(const char *name_utf8)
+{
+ char filename[MPD_PATH_MAX];
+
+ utf8_to_fs_playlist_path(filename, name_utf8);
+
+ if (unlink(filename) < 0)
+ return errno == ENOENT
+ ? PLAYLIST_RESULT_NO_SUCH_LIST
+ : PLAYLIST_RESULT_ERRNO;
+
+ return PLAYLIST_RESULT_SUCCESS;
+}
+
+enum playlist_result
spl_remove_index(const char *utf8path, unsigned pos)
{
GPtrArray *list;