id delegate; //< Delegate object
BOOL isArtFetched; //< Value used to determine of the artwork has been preparsed
BOOL areOthersMetaFetched; //< Value used to determine of the other meta has been preparsed
+ BOOL isArtURLFetched; //< Value used to determine of the other meta has been preparsed
VLCMediaState state; //< Current state of the media
}
if ( newValue != oldValue && !(oldValue && newValue && [oldValue compare:newValue] == NSOrderedSame) )
{
- if ([metaType isEqualToString:VLCMetaInformationArtworkURL])
+ // Only fetch the art if needed. (ie, create the NSImage, if it was requested before)
+ if (isArtFetched && [metaType isEqualToString:VLCMetaInformationArtworkURL])
{
[NSThread detachNewThreadSelector:@selector(fetchMetaInformationForArtWorkWithURL:)
toTarget:self
withObject:newValue];
- return;
}
[metaDictionary setValue:newValue forKeyPath:metaType];
* And all the other meta will be added through the libvlc event system */
[self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle];
}
-
+ else if( !isArtURLFetched && [keyPath hasPrefix:@"metaDictionary.artworkURL"])
+ {
+ isArtURLFetched = YES;
+ /* Force isArtURLFetched, that will trigger artwork download eventually
+ * And all the other meta will be added through the libvlc event system */
+ [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
+ }
+
return [super valueForKeyPath:keyPath];
}
@end