Skip to content

Commit

Permalink
Playlist Parsers: Parse all (even invalid) playlist entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
smithjd15 committed Nov 26, 2021
1 parent 590ab22 commit 41178a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 1 addition & 4 deletions src/playlistparsers/asxiniparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ SongList AsxIniParser::Load(QIODevice* device, const QString& playlist_path,
QString value = line.mid(equals + 1);

if (key.startsWith("ref")) {
Song song = LoadSong(value, 0, dir);
if (song.is_valid()) {
ret << song;
}
ret << LoadSong(value, 0, dir);
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/playlistparsers/asxparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ SongList ASXParser::Load(QIODevice* device, const QString& playlist_path,
}

while (!reader.atEnd() && Utilities::ParseUntilElement(&reader, "entry")) {
Song song = ParseTrack(&reader, dir);
if (song.is_valid()) {
ret << song;
}
ret << ParseTrack(&reader, dir);
}
return ret;
}
Expand Down
5 changes: 1 addition & 4 deletions src/playlistparsers/wplparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ void WplParser::ParseSeq(const QDir& dir, QXmlStreamReader* reader,
if (name == "media") {
QStringRef src = reader->attributes().value("src");
if (!src.isEmpty()) {
Song song = LoadSong(src.toString(), 0, dir);
if (song.is_valid()) {
songs->append(song);
}
songs->append(LoadSong(src.toString(), 0, dir));
}
} else {
Utilities::ConsumeCurrentElement(reader);
Expand Down
5 changes: 1 addition & 4 deletions src/playlistparsers/xspfparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ SongList XSPFParser::Load(QIODevice* device, const QString& playlist_path,
}

while (!reader.atEnd() && Utilities::ParseUntilElement(&reader, "track")) {
Song song = ParseTrack(&reader, dir);
if (song.is_valid()) {
ret << song;
}
ret << ParseTrack(&reader, dir);
}
return ret;
}
Expand Down

0 comments on commit 41178a8

Please sign in to comment.