Remove unnecessary checks.
This commit is contained in:
parent
07b2c38690
commit
a0f19e5923
@ -102,11 +102,7 @@ void M3UParser::Save(const SongList &songs, QIODevice *device, const QDir &dir)
|
|||||||
}
|
}
|
||||||
QString meta = QString("#EXTINF:%1,%2 - %3\n").arg(song.length()).arg(song.artist()).arg(song.title());
|
QString meta = QString("#EXTINF:%1,%2 - %3\n").arg(song.length()).arg(song.artist()).arg(song.title());
|
||||||
device->write(meta.toLatin1());
|
device->write(meta.toLatin1());
|
||||||
if (song.filetype() == Song::Type_Stream) {
|
device->write(MakeRelativeTo(song.filename(), dir).toLatin1());
|
||||||
device->write(song.filename().toLatin1());
|
|
||||||
} else {
|
|
||||||
device->write(MakeRelativeTo(song.filename(), dir).toLatin1());
|
|
||||||
}
|
|
||||||
device->write("\n");
|
device->write("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,12 +145,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir)
|
|||||||
QDomElement track_list = doc.createElement("trackList");
|
QDomElement track_list = doc.createElement("trackList");
|
||||||
root.appendChild(track_list);
|
root.appendChild(track_list);
|
||||||
foreach (const Song& song, songs) {
|
foreach (const Song& song, songs) {
|
||||||
QString url;
|
QString url = MakeRelativeTo(song.filename(), dir);
|
||||||
if (song.filetype() == Song::Type_Stream) {
|
|
||||||
url = song.filename();
|
|
||||||
} else {
|
|
||||||
url = QUrl::fromLocalFile(MakeRelativeTo(song.filename(), dir)).toString();
|
|
||||||
}
|
|
||||||
if (url.isEmpty()) {
|
if (url.isEmpty()) {
|
||||||
continue; // Skip empty items like Last.fm streams.
|
continue; // Skip empty items like Last.fm streams.
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user