Commit f1195781 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

playlist/preparser: do not "download" local art

The previous implementation would consider FILE:///art.jpg to be a
remote resources, meaning that it would try to "download" the file and
put it in the cache.

Given that the scheme part of an URI is case-insensitive (as stated in
RFC3986 3.1.), these changes make sure that we treat the affected
schemes in the way which was intended.

fixes #17759
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c351a478
......@@ -363,7 +363,7 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
char *psz_arturl = input_item_GetArtURL( p_item );
assert( *psz_arturl );
if( !strncmp( psz_arturl , "file://", 7 ) )
if( !strncasecmp( psz_arturl , "file://", 7 ) )
{
msg_Dbg( p_fetcher->object,
"Album art is local file, no need to cache" );
......
......@@ -309,8 +309,8 @@ static void Art( playlist_preparser_t *p_preparser, input_item_t *p_item )
const char *psz_arturl = vlc_meta_Get( p_item->p_meta, vlc_meta_ArtworkURL );
const char *psz_name = vlc_meta_Get( p_item->p_meta, vlc_meta_Title );
if( !psz_arturl || ( strncmp( psz_arturl, "file://", 7 ) &&
strncmp( psz_arturl, "attachment://", 13 ) ) )
if( !psz_arturl || ( strncasecmp( psz_arturl, "file://", 7 ) &&
strncasecmp( psz_arturl, "attachment://", 13 ) ) )
{
msg_Dbg( obj, "meta ok for %s, need to fetch art",
psz_name ? psz_name : "(null)" );
......
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