diff options
author | Max Kellermann <max@duempel.org> | 2008-10-15 22:35:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-15 22:35:13 +0200 |
commit | 8c0060fae44a94bdfe978d8d4a66589f5a03a074 (patch) | |
tree | fde581584c25e5e74d8a8336f54dc61d4a5f67db /src/mapper.c | |
parent | 0b44cad2ce2c6433f395650a5a70cf8b3473673c (diff) | |
download | mpd-8c0060fae44a94bdfe978d8d4a66589f5a03a074.tar.gz mpd-8c0060fae44a94bdfe978d8d4a66589f5a03a074.tar.xz mpd-8c0060fae44a94bdfe978d8d4a66589f5a03a074.zip |
playlist: added support for adding songs not in the music database
Clients which have authenticated via unix socket may add local files
to the MPD playlist, provided that they own the file.
Diffstat (limited to 'src/mapper.c')
-rw-r--r-- | src/mapper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mapper.c b/src/mapper.c index b1ac6f86c..1b704e55e 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -96,9 +96,12 @@ map_directory_child_fs(const struct directory *directory, const char *name, const char * map_song_fs(const struct song *song, char *buffer) { - assert(song->parent != NULL); + assert(song_is_file(song)); - return map_directory_child_fs(song->parent, song->url, buffer); + if (song_in_database(song)) + return map_directory_child_fs(song->parent, song->url, buffer); + else + return utf8_to_fs_charset(buffer, song->url); } const char * |