Skip to content

Commit c43d2b3

Browse files
committed
Avoid duplicates in StringList Matroska::Tag::complexPropertyKeys()
When using for example examples/tagwriter -C GENRE \ "name=GENRE,targetTypeValue=50,value=Soft Rock;name=GENRE,targetTypeValue=50,value=Classic Rock" \ path/to/file.mka the GENRE key was included twice and tagreader displayed the two genre tags twice.
1 parent 3db0d48 commit c43d2b3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

taglib/matroska/matroskatag.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,11 @@ StringList Matroska::Tag::complexPropertyKeys() const
551551
{
552552
StringList keys;
553553
for(const SimpleTag &t : std::as_const(d->tags)) {
554-
if(t.type() != SimpleTag::StringType ||
555-
t.trackUid() != 0 || t.editionUid() != 0 ||
556-
t.chapterUid() != 0 || t.attachmentUid() != 0 ||
557-
translateTag(t.name(), t.targetTypeValue()).isEmpty()) {
554+
if((t.type() != SimpleTag::StringType ||
555+
t.trackUid() != 0 || t.editionUid() != 0 ||
556+
t.chapterUid() != 0 || t.attachmentUid() != 0 ||
557+
translateTag(t.name(), t.targetTypeValue()).isEmpty()) &&
558+
!keys.contains(t.name())) {
558559
keys.append(t.name());
559560
}
560561
}

0 commit comments

Comments
 (0)