Skip to content

Commit

Permalink
XSPF Parser: Apply playlist metadata to song only if it is not in the…
Browse files Browse the repository at this point in the history
… library.
  • Loading branch information
smithjd15 committed Mar 28, 2022
1 parent 29e5163 commit 4f0e076
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/playlistparsers/xspfparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,17 @@ Song XSPFParser::ParseTrack(QXmlStreamReader* reader, const QDir& dir) const {
return_song:
Song song = LoadSong(location, 0, dir);

// Override metadata with what was in the playlist
song.set_title(title);
song.set_artist(artist);
song.set_album(album);
song.set_art_manual(art);
song.set_length_nanosec(nanosec);
song.set_track(track_num);
// If the song is not in the library, fill metadata with what was in the
// playlist.
if (!song.is_library_song()) {
song.set_title(title);
song.set_artist(artist);
song.set_album(album);
song.set_art_manual(art);
song.set_length_nanosec(nanosec);
song.set_track(track_num);
}

return song;
}

Expand Down

0 comments on commit 4f0e076

Please sign in to comment.