write both ID3v1 and ID3v2 tags to mp3 files

This commit is contained in:
Andrzej Rybczak
2009-09-30 21:31:46 +02:00
parent e84a8ddf98
commit 884cb0b7fb

View File

@@ -935,18 +935,12 @@ bool TagEditor::WriteTags(MPD::Song &s)
ext = ext.substr(ext.rfind(".")+1); ext = ext.substr(ext.rfind(".")+1);
ToLower(ext); ToLower(ext);
if (ext != "mp3") f.tag()->setTitle(ToWString(s.GetTitle()));
{ f.tag()->setArtist(ToWString(s.GetArtist()));
f.tag()->setTitle(ToWString(s.GetTitle())); f.tag()->setAlbum(ToWString(s.GetAlbum()));
f.tag()->setArtist(ToWString(s.GetArtist())); f.tag()->setYear(StrToInt(s.GetDate()));
f.tag()->setAlbum(ToWString(s.GetAlbum())); f.tag()->setTrack(StrToInt(s.GetTrack()));
f.tag()->setYear(StrToInt(s.GetDate())); f.tag()->setGenre(ToWString(s.GetGenre()));
f.tag()->setTrack(StrToInt(s.GetTrack()));
f.tag()->setGenre(ToWString(s.GetGenre()));
}
// it seems that writing COMM frame to mp3 files crashes taglib
// so the comment has to be written before we write ID3v2 tags
f.tag()->setComment(ToWString(s.GetComment())); f.tag()->setComment(ToWString(s.GetComment()));
if (!f.save()) if (!f.save())
return false; return false;