VLCTime * length; //< Duration of the media
NSMutableDictionary * metaDictionary; //< Meta data storage
id delegate; //< Delegate object
- BOOL preparsed; //< Value used to determine of the file has been preparsed
+ BOOL artFetched; //< Value used to determine of the artwork has been preparsed
VLCMediaState state;
}
libvlc_exception_t ex;
libvlc_exception_init( &ex );
+ artFetched = NO;
+
char * p_url = libvlc_media_descriptor_get_mrl( p_md, &ex );
catch_exception( &ex );
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
[self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle];
-
- /* Force VLCMetaInformationArtworkURL, that will trigger artwork fetching */
- [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
}
- (void)fetchMetaInformationFromLibVLCWithType:(NSString *)metaType
{
[self setState: [newStateAsNumber intValue]];
}
+
+- (id)valueForKeyPath:(NSString *)keyPath
+{
+ if( ![metaDictionary objectForKey:@"artwork"] && [keyPath isEqualToString:@"metaDictionary.artwork"])
+ {
+ artFetched = YES;
+ /* Force the retrieval of the artwork now that someone asked for it */
+ [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
+ }
+ return [super valueForKeyPath:keyPath];
+}
@end
/******************************************************************************