Commit 3341b282 authored by Max Kellermann's avatar Max Kellermann

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.
parent bb3b836d
......@@ -39,18 +39,13 @@
void
playlist_print_song(FILE *file, const DetachedSong &song)
{
if (playlist_saveAbsolutePaths &&
song.IsInDatabase() && song.IsFile()) {
const auto path = map_song_fs(song);
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())
fprintf(file, "%s\n", uri_fs.c_str());
}
const char *uri_utf8 = playlist_saveAbsolutePaths
? song.GetRealURI()
: song.GetURI();
const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
if (!uri_fs.IsNull())
fprintf(file, "%s\n", uri_fs.c_str());
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment