From 8c0060fae44a94bdfe978d8d4a66589f5a03a074 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Oct 2008 22:35:13 +0200 Subject: 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. --- src/mapper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mapper.c') 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 * -- cgit v1.2.3