Commit 21cf9cd7 authored by Philip Van Hoof's avatar Philip Van Hoof Committed by Philip Van Hoof

Bugfix for local mediaart

2009-02-12  Philip Van Hoof  <philip@codeminded.be>

        * src/libtracker-common/tracker-albumart.c: Bugfix for local mediaart


svn path=/trunk/; revision=2924
parent 51de9e6f
2009-02-12 Philip Van Hoof <philip@codeminded.be>
* src/libtracker-common/tracker-albumart.c: Bugfix for local mediaart
2009-02-12 Martyn Russell <martyn@imendio.com>
* src/libtracker-common/tracker-ioprio.c:
......
......@@ -34,6 +34,7 @@
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#ifdef HAVE_GDKPIXBUF
#include <gdk-pixbuf/gdk-pixbuf.h>
#endif
......@@ -565,7 +566,7 @@ tracker_albumart_get_path (const gchar *a,
const gchar *prefix,
const gchar *uri,
gchar **path,
gchar **local)
gchar **local_uri)
{
gchar *art_filename;
gchar *dir;
......@@ -612,6 +613,26 @@ tracker_albumart_get_path (const gchar *a,
art_filename = g_strdup_printf ("%s-%s-%s.jpeg", prefix?prefix:"album", str1, str2);
*path = g_build_filename (dir, art_filename, NULL);
if (local_uri) {
gchar *local_dir;
GFile *file, *parent;
if (strchr (uri, ':'))
file = g_file_new_for_uri (uri);
else
file = g_file_new_for_path (uri);
parent = g_file_get_parent (file);
local_dir = g_file_get_uri (parent);
*local_uri = g_strdup_printf ("%s/%s", local_dir, art_filename);
g_free (local_dir);
g_object_unref (file);
g_object_unref (parent);
}
g_free (dir);
g_free (art_filename);
g_free (str1);
......
......@@ -176,7 +176,10 @@ tracker_process_albumart (const unsigned char *buffer,
g_free (asuri);
}
if (!lcopied && g_file_test (art_path, G_FILE_TEST_EXISTS))
}
if (local_uri && !g_file_test (local_uri, G_FILE_TEST_EXISTS)) {
if (g_file_test (art_path, G_FILE_TEST_EXISTS))
tracker_albumart_copy_to_local (art_path, local_uri);
}
......
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