@@ -120,6 +120,11 @@ Song ASXParser::ParseTrack(QXmlStreamReader* reader, const QDir& dir) const {
120120
121121void ASXParser::Save (const SongList& songs, QIODevice* device, const QDir&,
122122 Playlist::Path path_type) const {
123+ QSettings s;
124+ s.beginGroup (Playlist::kSettingsGroup );
125+ bool writeMetadata = s.value (Playlist::kWriteMetadata , true ).toBool ();
126+ s.endGroup ();
127+
123128 QXmlStreamWriter writer (device);
124129 writer.setAutoFormatting (true );
125130 writer.setAutoFormattingIndent (2 );
@@ -129,12 +134,14 @@ void ASXParser::Save(const SongList& songs, QIODevice* device, const QDir&,
129134 writer.writeAttribute (" version" , " 3.0" );
130135 for (const Song& song : songs) {
131136 StreamElement entry (" entry" , &writer);
132- writer.writeTextElement (" title" , song.title ());
137+ if (!song.title ().isEmpty () && writeMetadata) {
138+ writer.writeTextElement (" title" , song.title ());
139+ }
133140 {
134141 StreamElement ref (" ref" , &writer);
135142 writer.writeAttribute (" href" , song.url ().toString ());
136143 }
137- if (!song.artist ().isEmpty ()) {
144+ if (!song.artist ().isEmpty () && writeMetadata ) {
138145 writer.writeTextElement (" author" , song.artist ());
139146 }
140147 }
0 commit comments