Remembers art url when an input with same artist & album needs art, so if it's a...
authorRafaël Carré <funman@videolan.org>
Thu, 30 Aug 2007 00:15:43 +0000 (00:15 +0000)
committerRafaël Carré <funman@videolan.org>
Thu, 30 Aug 2007 00:15:43 +0000 (00:15 +0000)
src/input/input_internal.h
src/input/meta.c

index ad8259c..6cf6fd5 100644 (file)
@@ -215,6 +215,7 @@ typedef struct playlist_album_t
 {
     char *psz_artist;
     char *psz_album;
+    char *psz_arturl;
     vlc_bool_t b_found;
 } playlist_album_t;
 
index 988406d..410cf4e 100644 (file)
@@ -110,7 +110,7 @@ int input_MetaFetch( playlist_t *p_playlist, input_item_t *p_item )
 }
 
 /* Return codes:
- *   0 : Art is in cache
+ *   0 : Art is in cache or is a local file
  *   1 : Art found, need to download
  *  -X : Error/not found
  */
@@ -145,8 +145,10 @@ int input_ArtFind( playlist_t *p_playlist, input_item_t *p_item )
                 free( psz_album );
                 if( album.b_found )
                 {
-                    /* Actually get URL from cache */
-                    input_FindArtInCache( p_playlist, p_item );
+                    if( !strncmp( album.psz_arturl, "file://", 7 ) )
+                        input_item_SetArtURL( p_item, album.psz_arturl );
+                    else /* Actually get URL from cache */
+                        input_FindArtInCache( p_playlist, p_item );
                     return 0;
                 }
                 else
@@ -202,6 +204,7 @@ int input_ArtFind( playlist_t *p_playlist, input_item_t *p_item )
         playlist_album_t a;
         a.psz_artist = psz_artist;
         a.psz_album = psz_album;
+        a.psz_arturl = input_item_GetArtURL( p_item );
         a.b_found = (i_ret == VLC_EGENERIC ? VLC_FALSE : VLC_TRUE );
         ARRAY_APPEND( p_playlist->p_fetcher->albums, a );
     }