]> git.sesse.net Git - vlc/commitdiff
playlist: cache artwork by download URL instead of title when artist and album meta...
authorJakob Leben <jleben@videolan.org>
Fri, 12 Feb 2010 00:25:13 +0000 (01:25 +0100)
committerJakob Leben <jleben@videolan.org>
Fri, 12 Feb 2010 00:28:52 +0000 (01:28 +0100)
Performs much better.
URL is sanitized by filename_sanitize() just as title before.

src/playlist/art.c
src/playlist/fetcher.c

index 6ec15b11d47a174d376c2138b391b19a508ae0ac..6538cbad6018eb2acb57c89eb524e7bc9f720c3d 100644 (file)
@@ -111,10 +111,9 @@ static char *ArtCachePath( input_item_t *p_item )
 
     psz_artist = vlc_meta_Get( p_item->p_meta, vlc_meta_Artist );
     psz_album = vlc_meta_Get( p_item->p_meta, vlc_meta_Album );
-    psz_title = vlc_meta_Get( p_item->p_meta, vlc_meta_Title );
-
-    if( !psz_title )
-        psz_title = p_item->psz_name;
+    /* cache by art URL instead of title - performs better in many cases
+       when multiple items without album and artist have same art URL */
+    psz_title = vlc_meta_Get( p_item->p_meta, vlc_meta_ArtworkURL );
 
     if( (!psz_artist || !psz_album ) && !psz_title )
         goto end;
index de85c8bf2cfb86a55fbb6e05119780a1b570309a..2075c0dfdbde6a626486c208b7354aa43a24a551 100644 (file)
@@ -234,7 +234,11 @@ static int FindArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
         if( p_module )
         {
             module_unneed( p_finder, p_module );
-            i_ret = 1;
+            /* Try immediately if found in cache by download URL */
+            if( !playlist_FindArtInCache( p_item ) )
+                i_ret = 0;
+            else
+                i_ret = 1;
         }
         vlc_object_release( p_finder );
     }