playlist_song: use map_to_relative_path()

This commit is contained in:
Max Kellermann 2012-08-14 02:12:36 +02:00
parent 45ff355835
commit adcd2c8eac
1 changed files with 4 additions and 4 deletions

View File

@ -134,11 +134,11 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
if (g_path_is_absolute(uri)) { if (g_path_is_absolute(uri)) {
/* XXX fs_charset vs utf8? */ /* XXX fs_charset vs utf8? */
const char *prefix = mapper_get_music_directory(); const char *suffix = map_to_relative_path(uri);
assert(suffix != NULL);
if (prefix != NULL && g_str_has_prefix(uri, prefix) && if (suffix != uri)
uri[strlen(prefix)] == '/') uri = suffix;
uri += strlen(prefix) + 1;
else if (!secure) { else if (!secure) {
/* local files must be relative to the music /* local files must be relative to the music
directory when "secure" is enabled */ directory when "secure" is enabled */