[tracker/media-art-enhancements: 9/16] libtracker-common: Fix media art paths when artist is not known



commit f4f6cd354aa350b7f3d21bdd009075eadcc66f66
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Thu Oct 20 17:11:14 2011 +0100

    libtracker-common: Fix media art paths when artist is not known
    
    Correct behaviour is prefix-md5sum(title)-md5sum( ) but previously
    we were generating prefix-md5sum( )-md5sum(title)

 src/libtracker-common/tracker-media-art.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-common/tracker-media-art.c b/src/libtracker-common/tracker-media-art.c
index bdc9b5d..8d5a0a4 100644
--- a/src/libtracker-common/tracker-media-art.c
+++ b/src/libtracker-common/tracker-media-art.c
@@ -222,6 +222,8 @@ tracker_media_art_get_path (const gchar  *artist,
                             gchar       **path,
                             gchar       **local_uri)
 {
+	const gchar *space_checksum = "7215ee9c7d9dc229d2921a40e899ec5f";
+
 	gchar *art_filename;
 	gchar *dir;
 	gchar *artist_down, *album_down;
@@ -280,10 +282,17 @@ tracker_media_art_get_path (const gchar  *artist,
 	g_free (artist_down);
 	g_free (album_down);
 
-	art_filename = g_strdup_printf ("%s-%s-%s.jpeg",
-	                                prefix ? prefix : "album",
-	                                artist_checksum,
-	                                album_checksum);
+	if (artist) {
+		art_filename = g_strdup_printf ("%s-%s-%s.jpeg",
+		                                prefix ? prefix : "album",
+		                                artist_checksum,
+		                                album_checksum);
+	} else {
+		art_filename = g_strdup_printf ("%s-%s-%s.jpeg",
+		                                prefix ? prefix : "album",
+		                                album_checksum,
+		                                space_checksum);
+	}
 
 	if (path) {
 		*path = g_build_filename (dir, art_filename, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]