[libmediaart/api-cleanup: 2/4] extract: Make GFile first parameter for _process_file()



commit b1fe6a33790244437a84122b2b36c47349861e83
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Feb 17 09:12:32 2014 +0000

    extract: Make GFile first parameter for _process_file()

 libmediaart/extract.c |   16 ++++++++--------
 libmediaart/extract.h |    6 +++---
 tests/mediaarttest.c  |   12 ++++++------
 3 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/libmediaart/extract.c b/libmediaart/extract.c
index af409ee..7d4e616 100644
--- a/libmediaart/extract.c
+++ b/libmediaart/extract.c
@@ -1321,13 +1321,13 @@ get_mtime_by_uri (const gchar *uri)
 
 /**
  * media_art_process_file:
+ * @file: File to be processed
  * @buffer: (array length=len)(allow-none): a buffer containing @file data, or %NULL
  * @len: length of @buffer, or 0
  * @mime: MIME type of @buffer, or %NULL
  * @type: The type of media
  * @artist: The media file artist name, or %NULL
  * @title: The media file title, or %NULL
- * @file: File to be processed
  *
  * Processes a media file. If you have extracted any embedded media art and
  * passed this in as @buffer, the image data will be converted to the correct
@@ -1345,13 +1345,13 @@ get_mtime_by_uri (const gchar *uri)
  * Since: 0.2.0
  */
 gboolean
-media_art_process_file (const guchar *buffer,
+media_art_process_file (GFile        *file,
+                        const guchar *buffer,
                         gsize         len,
                         const gchar  *mime,
                         MediaArtType  type,
                         const gchar  *artist,
-                        const gchar  *title,
-                        GFile        *file)
+                        const gchar  *title)
 {
        GFile *cache_art_file, *local_art_file;
        gchar *art_path, *uri;
@@ -1359,8 +1359,8 @@ media_art_process_file (const guchar *buffer,
        gboolean processed = TRUE, a_exists, created = FALSE;
        guint64 mtime, a_mtime = 0;
 
-       g_return_val_if_fail (type > MEDIA_ART_NONE && type < MEDIA_ART_TYPE_COUNT, FALSE);
        g_return_val_if_fail (G_IS_FILE (file), FALSE);
+       g_return_val_if_fail (type > MEDIA_ART_NONE && type < MEDIA_ART_TYPE_COUNT, FALSE);
 
        uri = g_file_get_uri (file);
        g_debug ("Processing media art: artist:'%s', title:'%s', type:'%s', uri:'%s'. Buffer is %ld bytes, 
mime:'%s'",
@@ -1519,13 +1519,13 @@ media_art_process (const unsigned char *buffer,
 
        file = g_file_new_for_uri (uri);
 
-       result = media_art_process_file (buffer,
+       result = media_art_process_file (file,
+                                        buffer,
                                         len,
                                         mime,
                                         type,
                                         artist,
-                                        title,
-                                        file);
+                                        title);
 
        g_object_unref (file);
 
diff --git a/libmediaart/extract.h b/libmediaart/extract.h
index 3744923..c4e716d 100644
--- a/libmediaart/extract.h
+++ b/libmediaart/extract.h
@@ -57,13 +57,13 @@ gboolean media_art_process  (const unsigned char  *buffer,
                              const gchar          *title,
                              const gchar          *uri);
 
-gboolean media_art_process_file (const guchar *buffer,
+gboolean media_art_process_file (GFile        *file,
+                                 const guchar *buffer,
                                 gsize         len,
                                 const gchar  *mime,
                                 MediaArtType  type,
                                 const gchar  *artist,
-                                const gchar  *title,
-                                GFile        *file);
+                                 const gchar  *title);
 
 G_END_DECLS
 
diff --git a/tests/mediaarttest.c b/tests/mediaarttest.c
index f09e30c..d02fb68 100644
--- a/tests/mediaarttest.c
+++ b/tests/mediaarttest.c
@@ -197,13 +197,13 @@ test_mediaart_embedded_mp3 (void)
        file = g_file_new_for_path (path);
        g_free (path);
 
-       retval = media_art_process_file (NULL,
+       retval = media_art_process_file (file,
+                                        NULL,
                                         0,
                                         "audio/mp3", /* mime */
                                         MEDIA_ART_ALBUM,
                                         "King Kilo", /* artist */
-                                        "Lanedo", /* title */
-                                        file);
+                                        "Lanedo");   /* title */
 
        g_assert_true (retval);
 
@@ -239,13 +239,13 @@ test_mediaart_png (void)
        g_free (out_uri);
 
        /* Process data */
-       retval = media_art_process_file (NULL,
+       retval = media_art_process_file (file,
+                                        NULL,
                                         0,
                                         "image/png", /* mime */
                                         MEDIA_ART_ALBUM,
                                         NULL, /* album */
-                                        "Lanedo", /* title */
-                                        file);
+                                        "Lanedo");  /* title */
 
        g_assert_true (retval);
 


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