Commit 3a164ef8 authored by Max Kellermann's avatar Max Kellermann

stored_playlist: spl_append_uri() returns enum playlist_result

The return value of spl_append_uri() was somewhat buggy: some branches returned ACK_* values, and some an enum playlist_result. Unify this.
parent d2606baa
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "ls.h" #include "ls.h"
#include "database.h" #include "database.h"
#include "idle.h" #include "idle.h"
#include "ack.h"
#include "os_compat.h" #include "os_compat.h"
static ListNode * static ListNode *
...@@ -317,7 +316,7 @@ spl_append_song(const char *utf8path, struct song *song) ...@@ -317,7 +316,7 @@ spl_append_song(const char *utf8path, struct song *song)
return PLAYLIST_RESULT_SUCCESS; return PLAYLIST_RESULT_SUCCESS;
} }
int enum playlist_result
spl_append_uri(const char *url, const char *utf8file) spl_append_uri(const char *url, const char *utf8file)
{ {
struct song *song; struct song *song;
...@@ -327,7 +326,7 @@ spl_append_uri(const char *url, const char *utf8file) ...@@ -327,7 +326,7 @@ spl_append_uri(const char *url, const char *utf8file)
return spl_append_song(utf8file, song); return spl_append_song(utf8file, song);
if (!isValidRemoteUtf8Url(url)) if (!isValidRemoteUtf8Url(url))
return ACK_ERROR_NO_EXIST; return PLAYLIST_RESULT_NO_SUCH_SONG;
song = song_remote_new(url); song = song_remote_new(url);
if (song) { if (song) {
...@@ -336,7 +335,7 @@ spl_append_uri(const char *url, const char *utf8file) ...@@ -336,7 +335,7 @@ spl_append_uri(const char *url, const char *utf8file)
return ret; return ret;
} }
return ACK_ERROR_NO_EXIST; return PLAYLIST_RESULT_NO_SUCH_SONG;
} }
enum playlist_result enum playlist_result
......
...@@ -39,7 +39,7 @@ spl_remove_index(const char *utf8path, int pos); ...@@ -39,7 +39,7 @@ spl_remove_index(const char *utf8path, int pos);
enum playlist_result enum playlist_result
spl_append_song(const char *utf8path, struct song *song); spl_append_song(const char *utf8path, struct song *song);
int enum playlist_result
spl_append_uri(const char *file, const char *utf8file); spl_append_uri(const char *file, const char *utf8file);
enum playlist_result enum playlist_result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment