Dictionary merge: Correctly drop empty data tags

This allows for TagLib to handle artwork reading where the file built-in
readers fail, such as the FFmpeg reader, which would require parsing the
stream data for artwork packets, a really wacky convention to have.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-17 03:00:35 -08:00
parent 007ec3696d
commit 2a27435f7e
1 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,9 @@
} else if([objTarget isKindOfClass:[NSNumber class]]) { } else if([objTarget isKindOfClass:[NSNumber class]]) {
NSNumber *val = (NSNumber *)objTarget; NSNumber *val = (NSNumber *)objTarget;
isEmpty = [val isEqualTo:@(0)]; isEmpty = [val isEqualTo:@(0)];
} else if([objTarget isKindOfClass:[NSData class]]) {
NSData *val = (NSData *)objTarget;
isEmpty = [val length] == 0;
} }
if(isEmpty) { if(isEmpty) {
[result setObject:obj forKey:key]; [result setObject:obj forKey:key];