[tracker/media-art-enhancements: 9/16] libtracker-common: Fix media art paths when artist is not known
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/media-art-enhancements: 9/16] libtracker-common: Fix media art paths when artist is not known
- Date: Wed, 14 Dec 2011 16:32:21 +0000 (UTC)
commit 439c662b1a5561d2dcfb29a824f2a5409d540156
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 7267f40..67db900 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;
@@ -286,10 +288,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]