* Remove the first COMM frame with an empty description. * * @param id3v2Tag ID3v2 tag */
| 370 | * @param id3v2Tag ID3v2 tag |
| 371 | */ |
| 372 | void removeCommentFrame(TagLib::ID3v2::Tag* id3v2Tag) |
| 373 | { |
| 374 | const TagLib::ID3v2::FrameList& frameList = id3v2Tag->frameList("COMM"); |
| 375 | for (auto it = frameList.begin(); |
| 376 | it != frameList.end(); |
| 377 | ++it) { |
| 378 | if (auto id3Frame = |
| 379 | dynamic_cast<TagLib::ID3v2::CommentsFrame*>(*it); |
| 380 | id3Frame && id3Frame->description().isEmpty()) { |
| 381 | id3v2Tag->removeFrame(id3Frame, true); |
| 382 | break; |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | void addTagLibFrame(TagLib::ID3v2::Tag* id3v2Tag, TagLib::ID3v2::Frame* frame) |
| 388 | { |
no test coverage detected