mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-06 21:31:23 +01:00
Always save metadata in playlist for Tidal, Qobuz and Subsonic songs
Fixes #851
This commit is contained in:
parent
5a50285dee
commit
f4d8d73970
@ -131,14 +131,14 @@ void M3UParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(Playlist::kSettingsGroup);
|
||||
bool writeMetadata = s.value(Playlist::kWriteMetadata, true).toBool();
|
||||
bool write_metadata = s.value(Playlist::kWriteMetadata, true).toBool();
|
||||
s.endGroup();
|
||||
|
||||
for (const Song &song : songs) {
|
||||
if (song.url().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (writeMetadata) {
|
||||
if (write_metadata || (song.is_stream() && !song.is_radio())) {
|
||||
QString meta = QString("#EXTINF:%1,%2 - %3\n").arg(song.length_nanosec() / kNsecPerSec).arg(song.artist(), song.title());
|
||||
device->write(meta.toUtf8());
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(Playlist::kSettingsGroup);
|
||||
bool writeMetadata = s.value(Playlist::kWriteMetadata, true).toBool();
|
||||
bool write_metadata = s.value(Playlist::kWriteMetadata, true).toBool();
|
||||
s.endGroup();
|
||||
|
||||
StreamElement tracklist("trackList", &writer);
|
||||
@ -159,7 +159,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
StreamElement track("track", &writer);
|
||||
writer.writeTextElement("location", filename_or_url);
|
||||
|
||||
if (writeMetadata) {
|
||||
if (write_metadata || (song.is_stream() && !song.is_radio())) {
|
||||
writer.writeTextElement("title", song.title());
|
||||
if (!song.artist().isEmpty()) {
|
||||
writer.writeTextElement("creator", song.artist());
|
||||
|
Loading…
Reference in New Issue
Block a user