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.
This commit is contained in:
Max Kellermann
2008-10-15 22:35:13 +02:00
parent 0b44cad2ce
commit 8c0060fae4
6 changed files with 59 additions and 6 deletions

View File

@@ -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 *