PlaylistSave: use DetachedSong::GetRealURI() in playlist_print_song()

The DetachedSong instance already knows its own absolute path, and
there is no need to ask the mapper again.
This commit is contained in:
Max Kellermann 2014-02-07 18:33:08 +01:00
parent bb3b836dbb
commit 3341b282b7

View File

@ -39,18 +39,13 @@
void void
playlist_print_song(FILE *file, const DetachedSong &song) playlist_print_song(FILE *file, const DetachedSong &song)
{ {
if (playlist_saveAbsolutePaths && const char *uri_utf8 = playlist_saveAbsolutePaths
song.IsInDatabase() && song.IsFile()) { ? song.GetRealURI()
const auto path = map_song_fs(song); : song.GetURI();
if (!path.IsNull())
fprintf(file, "%s\n", path.c_str());
} else {
const auto uri_utf8 = song.GetURI();
const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
if (!uri_fs.IsNull()) const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
fprintf(file, "%s\n", uri_fs.c_str()); if (!uri_fs.IsNull())
} fprintf(file, "%s\n", uri_fs.c_str());
} }
void void