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 @@ ...@@ -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);
const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
if (!uri_fs.IsNull()) if (!uri_fs.IsNull())
fprintf(file, "%s\n", uri_fs.c_str()); fprintf(file, "%s\n", uri_fs.c_str());
}
} }
void 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