mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Convert TDRC to TYER+TDAT+TIME
This commit is contained in:
parent
1453a7b157
commit
d3df66f196
@ -383,6 +383,18 @@ void ID3v2::Tag::downgradeFrames(FrameList *frames, FrameList *newFrames) const
|
||||
frameTYER->setText(content.substr(0, 4));
|
||||
frames->append(frameTYER);
|
||||
newFrames->append(frameTYER);
|
||||
if(content.size() >= 10 && content[4] == '-' && content[7] == '-') {
|
||||
ID3v2::TextIdentificationFrame *frameTDAT = new ID3v2::TextIdentificationFrame("TDAT", String::Latin1);
|
||||
frameTDAT->setText(content.substr(8, 2) + content.substr(5, 2));
|
||||
frames->append(frameTDAT);
|
||||
newFrames->append(frameTDAT);
|
||||
if(content.size() >= 16 && content[10] == 'T' && content[13] == ':') {
|
||||
ID3v2::TextIdentificationFrame *frameTIME = new ID3v2::TextIdentificationFrame("TIME", String::Latin1);
|
||||
frameTIME->setText(content.substr(11, 2) + content.substr(14, 2));
|
||||
frames->append(frameTIME);
|
||||
newFrames->append(frameTIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// FIXME migrate TIPL and TMCL to IPLS
|
||||
|
@ -486,7 +486,7 @@ public:
|
||||
tf->setText("2011-03-16");
|
||||
foo.ID3v2Tag()->addFrame(tf);
|
||||
tf = new ID3v2::TextIdentificationFrame("TDRC", String::Latin1);
|
||||
tf->setText("2012-04-17");
|
||||
tf->setText("2012-04-17T12:01");
|
||||
foo.ID3v2Tag()->addFrame(tf);
|
||||
foo.ID3v2Tag()->addFrame(new ID3v2::TextIdentificationFrame("TDRL", String::Latin1));
|
||||
foo.ID3v2Tag()->addFrame(new ID3v2::TextIdentificationFrame("TDTG", String::Latin1));
|
||||
|
Loading…
Reference in New Issue
Block a user