Commit 414d5b64 authored by Max Kellermann's avatar Max Kellermann

PlaylistSong: don't map relative URI to absolute path

This didn't make sense.
parent a237e7f8
......@@ -51,30 +51,14 @@ merge_song_metadata(DetachedSong &dest, const DetachedSong &base,
static DetachedSong *
apply_song_metadata(DetachedSong *dest, const DetachedSong &src)
{
DetachedSong *tmp;
assert(dest != nullptr);
if (!src.GetTag().IsDefined() &&
src.GetStartMS() == 0 && src.GetEndMS() == 0)
return dest;
if (dest->IsInDatabase()) {
const auto path_fs = map_song_fs(*dest);
if (path_fs.IsNull())
return dest;
std::string path_utf8 = path_fs.ToUTF8();
if (path_utf8.empty())
path_utf8 = path_fs.c_str();
tmp = new DetachedSong(std::move(path_utf8));
merge_song_metadata(*tmp, *dest, src);
} else {
tmp = new DetachedSong(dest->GetURI());
merge_song_metadata(*tmp, *dest, src);
}
DetachedSong *tmp = new DetachedSong(dest->GetURI());
merge_song_metadata(*tmp, *dest, src);
if (dest->GetTag().IsDefined() && dest->GetTag().time > 0 &&
src.GetStartMS() > 0 && src.GetEndMS() == 0 &&
......
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