Skip to content

Commit 1989e57

Browse files
committed
XSPF Parser: Apply playlist metadata to song only if it is not in the library.
1 parent d6265d4 commit 1989e57

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

src/playlistparsers/xspfparser.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ Song XSPFParser::ParseTrack(QXmlStreamReader* reader, const QDir& dir) const {
102102
return_song:
103103
Song song = LoadSong(location, 0, dir);
104104

105-
// Override metadata with what was in the playlist
106-
song.set_title(title);
107-
song.set_artist(artist);
108-
song.set_album(album);
109-
song.set_art_manual(art);
110-
song.set_length_nanosec(nanosec);
111-
song.set_track(track_num);
105+
// If the song is not in the library, fill metadata with what was in the
106+
// playlist.
107+
if (!song.is_library_song()) {
108+
song.set_title(title);
109+
song.set_artist(artist);
110+
song.set_album(album);
111+
song.set_art_manual(art);
112+
song.set_length_nanosec(nanosec);
113+
song.set_track(track_num);
114+
}
115+
112116
return song;
113117
}
114118

0 commit comments

Comments
 (0)