album art: the corrects picture URLs begin with "file://" else, we have to download...
authorRafaël Carré <funman@videolan.org>
Tue, 16 Oct 2007 12:27:24 +0000 (12:27 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 16 Oct 2007 12:27:24 +0000 (12:27 +0000)
sets the ArtworkURL to the file in cache also when it had been extracted previously

src/input/meta.c
src/playlist/engine.c

index 7c93118..92ac141 100644 (file)
@@ -165,7 +165,7 @@ int input_ArtFind( playlist_t *p_playlist, input_item_t *p_item )
     input_FindArtInCache( p_playlist, p_item );
 
     char *psz_arturl = input_item_GetArtURL( p_item );
-    if( !EMPTY_STR( psz_arturl ) )
+    if( !strncmp( psz_arturl, "file://", strlen( "file://" ) ) )
     {
         free( psz_arturl );
         return 0; /* Art is in cache, no need to go further */
@@ -542,7 +542,10 @@ void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input )
 
     /* Check if we already dumped it */
     if( !utf8_stat( psz_filename+7, &s ) )
+    {
+        vlc_meta_Set( p_item->p_meta, vlc_meta_ArtworkURL, psz_filename );
         return;
+    }
 
     f = utf8_fopen( psz_filename+7, "w" );
     if( f )
index 1c81870..8d852c9 100644 (file)
@@ -534,7 +534,7 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
             }
             /* We already have all needed meta, but we need art right now */
             else if( p_playlist->p_fetcher->i_art_policy == ALBUM_ART_ALL &&
-                     EMPTY_STR( psz_arturl ) )
+                     strncmp( psz_arturl, "file://", strlen("file://") ) )
             {
                 preparse_item_t p;
                 PL_DEBUG("meta ok for %s, need to fetch art", psz_name );