PlaylistSong: always merge tags and LastModified
This commit is contained in:
parent
80d9baa9e8
commit
74e95e88d8
@ -33,7 +33,7 @@
|
|||||||
static void
|
static void
|
||||||
merge_song_metadata(DetachedSong &add, const DetachedSong &base)
|
merge_song_metadata(DetachedSong &add, const DetachedSong &base)
|
||||||
{
|
{
|
||||||
{
|
if (base.GetTag().IsDefined()) {
|
||||||
TagBuilder builder(add.GetTag());
|
TagBuilder builder(add.GetTag());
|
||||||
builder.Complement(base.GetTag());
|
builder.Complement(base.GetTag());
|
||||||
add.SetTag(builder.Commit());
|
add.SetTag(builder.Commit());
|
||||||
@ -42,16 +42,6 @@ merge_song_metadata(DetachedSong &add, const DetachedSong &base)
|
|||||||
add.SetLastModified(base.GetLastModified());
|
add.SetLastModified(base.GetLastModified());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
apply_song_metadata(DetachedSong &dest, const DetachedSong &src)
|
|
||||||
{
|
|
||||||
if (!src.GetTag().IsDefined() &&
|
|
||||||
src.GetStartMS() == 0 && src.GetEndMS() == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
merge_song_metadata(dest, src);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
playlist_check_load_song(DetachedSong &song, const SongLoader &loader)
|
playlist_check_load_song(DetachedSong &song, const SongLoader &loader)
|
||||||
{
|
{
|
||||||
@ -63,7 +53,7 @@ playlist_check_load_song(DetachedSong &song, const SongLoader &loader)
|
|||||||
if (!song.HasRealURI() && tmp->HasRealURI())
|
if (!song.HasRealURI() && tmp->HasRealURI())
|
||||||
song.SetRealURI(tmp->GetRealURI());
|
song.SetRealURI(tmp->GetRealURI());
|
||||||
|
|
||||||
apply_song_metadata(song, *tmp);
|
merge_song_metadata(song, *tmp);
|
||||||
delete tmp;
|
delete tmp;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user