[tracker/tracker-0.6] Adapted album-art name determination to follow new spec rules



commit 43972b29fd5700a3d8c00d64eaf5f077eca0dc81
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Apr 22 10:44:57 2009 +0200

    Adapted album-art name determination to follow new spec rules
    
    Backport from master to tracker-0.6 branch
---
 src/libtracker-common/tracker-albumart.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/libtracker-common/tracker-albumart.c b/src/libtracker-common/tracker-albumart.c
index 97a4480..bc9d446 100644
--- a/src/libtracker-common/tracker-albumart.c
+++ b/src/libtracker-common/tracker-albumart.c
@@ -239,6 +239,24 @@ strip_characters (const gchar *original)
 
 	retval[y] = 0;
 
+	y--;
+	while (retval[y] == ' ') {
+		retval[y] = 0;
+		y--;
+	}
+
+	if (retval[0] == ' ') {
+		guint r = 0;
+		gchar *newr;
+
+		while (retval[r] == ' ')
+			r++;
+
+		newr = g_strdup (retval + r);
+		g_free (retval);
+		retval = newr;
+	}
+
 	return retval;
 }
 



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