aboutsummaryrefslogtreecommitdiffstats
path: root/src/stored_playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 16:23:33 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 16:23:33 +0100
commit17d8bdb427eb179b06bff8f9229decafc93de1d6 (patch)
tree0c8c0d0b47bd79ff0db8cee90c5838ec16bb0da9 /src/stored_playlist.c
parent7d87f71d830c62714c67af4728455b57241c90e7 (diff)
downloadmpd-17d8bdb427eb179b06bff8f9229decafc93de1d6.tar.gz
mpd-17d8bdb427eb179b06bff8f9229decafc93de1d6.tar.xz
mpd-17d8bdb427eb179b06bff8f9229decafc93de1d6.zip
playlist: use uri_has_scheme() instead of isRemoteUrl()
For internal checks (i.e. not in command.c), we need to check whether an URI is in the databse, in the local file system or a remote URI with a scheme.
Diffstat (limited to '')
-rw-r--r--src/stored_playlist.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index a21feeeee..25a4ce85a 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -165,7 +165,7 @@ spl_load(const char *utf8path)
g_strchomp(buffer);
- if (!isRemoteUrl(s)) {
+ if (!uri_has_scheme(s)) {
struct song *song;
path_utf8 = map_fs_to_utf8(s, path_max_tmp);
@@ -366,21 +366,20 @@ spl_append_uri(const char *url, const char *utf8file)
{
struct song *song;
- song = db_get_song(url);
- if (song)
- return spl_append_song(utf8file, song);
-
- if (!isRemoteUrl(url))
- return PLAYLIST_RESULT_NO_SUCH_SONG;
+ if (uri_has_scheme(url)) {
+ enum playlist_result ret;
- song = song_remote_new(url);
- if (song) {
- enum playlist_result ret = spl_append_song(utf8file, song);
+ song = song_remote_new(url);
+ ret = spl_append_song(utf8file, song);
song_free(song);
return ret;
- }
+ } else {
+ song = db_get_song(url);
+ if (song == NULL)
+ return PLAYLIST_RESULT_NO_SUCH_SONG;
- return PLAYLIST_RESULT_NO_SUCH_SONG;
+ return spl_append_song(utf8file, song);
+ }
}
static enum playlist_result