[vlc-devel] commit: playlist: cache artwork by download URL instead of title when artist and album meta missing (Jakob Leben )

git version control git at videolan.org
Fri Feb 12 03:29:10 CET 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Fri Feb 12 01:25:13 2010 +0100| [f9fa3d512123a4c228ffa07ff6b7f5307c4feb00] | committer: Jakob Leben 

playlist: cache artwork by download URL instead of title when artist and album meta missing

Performs much better.
URL is sanitized by filename_sanitize() just as title before.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9fa3d512123a4c228ffa07ff6b7f5307c4feb00
---

 src/playlist/art.c     |    7 +++----
 src/playlist/fetcher.c |    6 +++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/playlist/art.c b/src/playlist/art.c
index 6ec15b1..6538cba 100644
--- a/src/playlist/art.c
+++ b/src/playlist/art.c
@@ -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;
diff --git a/src/playlist/fetcher.c b/src/playlist/fetcher.c
index de85c8b..2075c0d 100644
--- a/src/playlist/fetcher.c
+++ b/src/playlist/fetcher.c
@@ -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 );
     }




More information about the vlc-devel mailing list