]> git.sesse.net Git - vlc/commitdiff
- Don't cache files to ~/.vlc/art/(null)/(null)/
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 30 Sep 2006 19:37:39 +0000 (19:37 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 30 Sep 2006 19:37:39 +0000 (19:37 +0000)
 - Check if file already exists in the download function.

src/input/meta.c

index 3b1891a856721b048d741ac0fbfae8f9844d86ae..8c4bd34995bd4079e5880778901cac6d08c7f9a1 100644 (file)
@@ -171,6 +171,16 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
                         || !*p_item->p_meta->psz_arturl )
         return VLC_EGENERIC;
 
+    /* FIXME: use an alternate saving filename scheme if we don't have
+     * the artist or album name */
+    if(    !p_item->p_meta->psz_artist
+        || !p_item->p_meta->psz_album )
+        return VLC_EGENERIC;
+
+    /* Check if file doesn't already exist */
+    if( input_FindArtInCache( p_playlist, p_item ) == VLC_SUCCESS )
+        return VLC_SUCCESS;
+
     psz_type = strrchr( p_item->p_meta->psz_arturl, '.' );
 
     /* Todo: get a helper to do this */