Commit 89d055fe authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Tarax

playlist: fix displaying of subtitle Metadata

parent faf44190
......@@ -468,7 +468,7 @@
}
}
if ((trackCount > 0) && (spuTracks.count > 0)) {
if ((trackCount > 0) || (spuTracks.count > 0)) {
if (mediaInfo.length > 0)
[mediaInfo appendString:@"\n\n"];
......@@ -477,19 +477,20 @@
else
[mediaInfo appendString:@"1 subtitles track"];
if (spuTracks.count > 0) {
[mediaInfo appendString:@" ("];
for (NSUInteger x = 0; x < trackCount; x++) {
NSString *language = [spuTracks[x] valueForKey:@"language"];
[mediaInfo appendString:@" ("];
for (NSUInteger x = 0; x < trackCount; x++) {
NSString *language = [spuTracks[x] valueForKey:@"language"];
if (language) {
if (x != 0)
[mediaInfo appendFormat:@", %@", [language uppercaseString]];
else
[mediaInfo appendString:[language uppercaseString]];
if (language) {
if (x != 0)
[mediaInfo appendFormat:@", %@", [language uppercaseString]];
else
[mediaInfo appendString:[language uppercaseString]];
}
}
[mediaInfo appendString:@")"];
}
[mediaInfo appendString:@")"];
}
self.metaDataLabel.text = mediaInfo;
......
......@@ -453,7 +453,7 @@
}
}
if ((trackCount > 0) && (spuTracks.count > 0)) {
if ((trackCount > 0) || (spuTracks.count > 0)) {
if (mediaInfo.length > 0)
[mediaInfo appendString:@"\n\n"];
......@@ -462,6 +462,7 @@
else
[mediaInfo appendString:@"1 subtitles track"];
if (spuTracks.count > 0) {
[mediaInfo appendString:@" ("];
for (NSUInteger x = 0; x < trackCount; x++) {
NSString *language = [spuTracks[x] valueForKey:@"language"];
......@@ -475,6 +476,7 @@
}
[mediaInfo appendString:@")"];
}
}
self.metaDataLabel.text = mediaInfo;
[self.metaDataLabel sizeToFit];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment