[libmediaart/remove-mediaartlocal-rebased-on-async-api: 2/3] fixup
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libmediaart/remove-mediaartlocal-rebased-on-async-api: 2/3] fixup
- Date: Fri, 17 Oct 2014 10:21:35 +0000 (UTC)
commit 66610c2717cbb10d4c091b596779928e793ed36c
Author: Martyn Russell <martyn lanedo com>
Date: Fri Oct 17 11:16:42 2014 +0100
fixup
libmediaart/extract.c | 74 ++++++++++++++++++++++++------------------------
1 files changed, 37 insertions(+), 37 deletions(-)
---
diff --git a/libmediaart/extract.c b/libmediaart/extract.c
index f5abeed..b1bedfa 100644
--- a/libmediaart/extract.c
+++ b/libmediaart/extract.c
@@ -1024,7 +1024,7 @@ media_art_set (const unsigned char *buffer,
GError **error)
{
GError *local_error = NULL;
- gchar *artist_path;
+ gchar *local_path;
gchar *album_path;
gchar *md5_album = NULL;
gchar *md5_tmp = NULL;
@@ -1037,7 +1037,7 @@ media_art_set (const unsigned char *buffer,
/* What we do here:
*
- * NOTE: artist_path is the final location for the media art
+ * NOTE: local_path is the final location for the media art
* always here.
*
* 1. Get details based on artist and title.
@@ -1045,15 +1045,15 @@ media_art_set (const unsigned char *buffer,
* i) save buffer to jpeg only.
* 3. If no cache for ALBUM!:
* i) save buffer to jpeg.
- * ii) symlink to artist_path.
+ * ii) symlink to local_path.
* 4. If buffer is jpeg:
* i) If the MD5sum is the same for buffer and existing
- * file, symlink to artist_path.
- * ii) Otherwise, save buffer to jpeg and call it artist_path.
+ * file, symlink to local_path.
+ * ii) Otherwise, save buffer to jpeg and call it local_path.
* 5. If buffer is not jpeg, save to disk:
* i) Compare to existing md5sum cache for ALBUM.
- * ii) If same, unlink new jpeg from buffer and symlink to artist_path.
- * iii) If not same, rename new buffer to artist_path.
+ * ii) If same, unlink new jpeg from buffer and symlink to local_path.
+ * iii) If not same, rename new buffer to local_path.
* iv) If we couldn't save the buffer or read from the new
* cache, unlink it...
*/
@@ -1062,19 +1062,19 @@ media_art_set (const unsigned char *buffer,
media_art_get_path (artist,
title,
media_art_type_name[type],
- &artist_path);
+ &local_path);
/* 2. If not ALBUM! or artist is unknown:
* i) save buffer to jpeg only.
*/
if (type != MEDIA_ART_ALBUM || (artist == NULL || g_strcmp0 (artist, " ") == 0)) {
- retval = media_art_buffer_to_jpeg (buffer, len, mime, artist_path, &local_error);
+ retval = media_art_buffer_to_jpeg (buffer, len, mime, local_path, &local_error);
g_debug ("Saving buffer to jpeg (%ld bytes) --> '%s', %s",
len,
- artist_path,
+ local_path,
local_error ? local_error->message : "no error given");
- g_free (artist_path);
+ g_free (local_path);
if (local_error) {
g_propagate_error (error, local_error);
@@ -1086,7 +1086,7 @@ media_art_set (const unsigned char *buffer,
/* 3. If no cache for ALBUM!:
* i) save buffer to jpeg.
- * ii) symlink to artist_path.
+ * ii) symlink to local_path.
*/
media_art_get_path (NULL,
title,
@@ -1098,7 +1098,7 @@ media_art_set (const unsigned char *buffer,
g_debug ("Saving buffer to jpeg (%ld bytes) --> '%s', %s",
len,
- artist_path,
+ local_path,
local_error ? local_error->message : "no error given");
if (local_error) {
@@ -1109,7 +1109,7 @@ media_art_set (const unsigned char *buffer,
* exist, make one and make a symlink
* to album-md5-md5.jpg
*/
- retval = symlink (album_path, artist_path) == 0;
+ retval = symlink (album_path, local_path) == 0;
if (!retval) {
g_set_error (error,
@@ -1117,18 +1117,18 @@ media_art_set (const unsigned char *buffer,
MEDIA_ART_ERROR_SYMLINK_FAILED,
"Could not symlink '%s' to '%s', %s",
album_path,
- artist_path,
+ local_path,
g_strerror (errno));
}
g_debug ("Creating symlink '%s' --> '%s', %s",
album_path,
- artist_path,
+ local_path,
retval ? g_strerror (errno) : "no error given");
}
g_free (album_path);
- g_free (artist_path);
+ g_free (local_path);
return retval;
}
@@ -1145,7 +1145,7 @@ media_art_set (const unsigned char *buffer,
g_propagate_error (error, local_error);
g_free (album_path);
- g_free (artist_path);
+ g_free (local_path);
/* FIXME: Is it right to return TRUE here ?*/
return TRUE;
@@ -1153,8 +1153,8 @@ media_art_set (const unsigned char *buffer,
/* 4. If buffer is jpeg:
* i) If the MD5sum is the same for buffer and existing
- * file, symlink to artist_path.
- * ii) Otherwise, save buffer to jpeg and call it artist_path.
+ * file, symlink to local_path.
+ * ii) Otherwise, save buffer to jpeg and call it local_path.
*/
if (is_buffer_jpeg (mime, buffer, len)) {
gchar *md5_data;
@@ -1165,7 +1165,7 @@ media_art_set (const unsigned char *buffer,
* a symlink to album-md5-md5.jpg
*/
if (g_strcmp0 (md5_data, md5_album) == 0) {
- retval = symlink (album_path, artist_path) == 0;
+ retval = symlink (album_path, local_path) == 0;
if (!retval) {
g_set_error (error,
@@ -1173,23 +1173,23 @@ media_art_set (const unsigned char *buffer,
MEDIA_ART_ERROR_SYMLINK_FAILED,
"Could not symlink '%s' to '%s', %s",
album_path,
- artist_path,
+ local_path,
g_strerror (errno));
}
g_debug ("Creating symlink '%s' --> '%s', %s",
album_path,
- artist_path,
+ local_path,
retval ? g_strerror (errno) : "no error given");
} else {
/* If album-space-md5.jpg isn't the same as
* buffer, make a new album-md5-md5.jpg
*/
- retval = media_art_buffer_to_jpeg (buffer, len, mime, artist_path, &local_error);
+ retval = media_art_buffer_to_jpeg (buffer, len, mime, local_path, &local_error);
g_debug ("Saving buffer to jpeg (%ld bytes) --> '%s', %s",
len,
- artist_path,
+ local_path,
local_error ? local_error->message : "no error given");
if (local_error) {
@@ -1200,15 +1200,15 @@ media_art_set (const unsigned char *buffer,
g_free (md5_data);
g_free (album_path);
- g_free (artist_path);
+ g_free (local_path);
return retval;
}
/* 5. If buffer is not jpeg:
* i) Compare to existing md5sum data with cache for ALBUM.
- * ii) If same, unlink new jpeg from buffer and symlink to artist_path.
- * iii) If not same, rename new buffer to artist_path.
+ * ii) If same, unlink new jpeg from buffer and symlink to local_path.
+ * iii) If not same, rename new buffer to local_path.
* iv) If we couldn't save the buffer or read from the new
* cache, unlink it...
*/
@@ -1217,7 +1217,7 @@ media_art_set (const unsigned char *buffer,
g_debug ("Saving buffer to jpeg (%ld bytes) --> '%s', %s",
len,
- artist_path,
+ local_path,
local_error ? local_error->message : "no error given");
if (local_error) {
@@ -1230,7 +1230,7 @@ media_art_set (const unsigned char *buffer,
g_free (temp);
g_free (md5_album);
g_free (album_path);
- g_free (artist_path);
+ g_free (local_path);
return FALSE;
}
@@ -1247,7 +1247,7 @@ media_art_set (const unsigned char *buffer,
/* If album-space-md5.jpg is the same as
* buffer, make a symlink to album-md5-md5.jpg
*/
- retval = symlink (album_path, artist_path) == 0;
+ retval = symlink (album_path, local_path) == 0;
if (!retval) {
g_set_error (error,
@@ -1255,19 +1255,19 @@ media_art_set (const unsigned char *buffer,
MEDIA_ART_ERROR_SYMLINK_FAILED,
"Could not symlink '%s' to '%s', %s",
album_path,
- artist_path,
+ local_path,
g_strerror (errno));
}
g_debug ("Creating symlink '%s' --> '%s', %s",
album_path,
- artist_path,
+ local_path,
retval ? g_strerror (errno) : "no error given");
} else {
/* If album-space-md5.jpg isn't the same as
* buffer, make a new album-md5-md5.jpg
*/
- retval = g_rename (temp, artist_path) == 0;
+ retval = g_rename (temp, local_path) == 0;
if (!retval) {
g_set_error (error,
@@ -1275,13 +1275,13 @@ media_art_set (const unsigned char *buffer,
MEDIA_ART_ERROR_RENAME_FAILED,
"Could not rename '%s' to '%s', %s",
temp,
- artist_path,
+ local_path,
g_strerror (errno));
}
g_debug ("Renaming temp file '%s' --> '%s', %s",
temp,
- artist_path,
+ local_path,
retval ? g_strerror (errno) : "no error given");
}
@@ -1298,7 +1298,7 @@ media_art_set (const unsigned char *buffer,
g_free (md5_album);
g_free (album_path);
- g_free (artist_path);
+ g_free (local_path);
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]