Commit f9fa3d51 authored by Jakob Leben's avatar 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.
parent 161886f4
...@@ -111,10 +111,9 @@ static char *ArtCachePath( input_item_t *p_item ) ...@@ -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_artist = vlc_meta_Get( p_item->p_meta, vlc_meta_Artist );
psz_album = vlc_meta_Get( p_item->p_meta, vlc_meta_Album ); psz_album = vlc_meta_Get( p_item->p_meta, vlc_meta_Album );
psz_title = vlc_meta_Get( p_item->p_meta, vlc_meta_Title ); /* cache by art URL instead of title - performs better in many cases
when multiple items without album and artist have same art URL */
if( !psz_title ) psz_title = vlc_meta_Get( p_item->p_meta, vlc_meta_ArtworkURL );
psz_title = p_item->psz_name;
if( (!psz_artist || !psz_album ) && !psz_title ) if( (!psz_artist || !psz_album ) && !psz_title )
goto end; goto end;
......
...@@ -234,7 +234,11 @@ static int FindArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item ) ...@@ -234,7 +234,11 @@ static int FindArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
if( p_module ) if( p_module )
{ {
module_unneed( p_finder, 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 ); vlc_object_release( p_finder );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment