[libmediaart/remove-mediaartlocal: 1/2] cache: Added media_art_remove_async() and _finish()



commit d5c0a9ac46eaa10e54518907ff63c9c60d57b2fe
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Sep 10 11:26:11 2014 +0100

    cache: Added media_art_remove_async() and _finish()
    
    Part of this API changes makes the media_art_get_{path|file}() APIs not do
    i/o operations like creating the cache directory. This is now done in
    media_art_process_new().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724879

 tests/mediaarttest.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/tests/mediaarttest.c b/tests/mediaarttest.c
index f93845c..fb03d6a 100644
--- a/tests/mediaarttest.c
+++ b/tests/mediaarttest.c
@@ -362,6 +362,7 @@ test_mediaart_process_buffer (void)
        GCancellable *cancellable;
        GFile *file;
        GError *error = NULL;
+       gchar *dir;
        gchar *path;
        gchar *out_path = NULL;
        gchar *out_uri = NULL;
@@ -377,17 +378,22 @@ test_mediaart_process_buffer (void)
        media_art_get_path ("Lanedo", /* artist / title */
                            NULL,     /* album */
                            NULL,     /* prefix */
-                           path,
-                           &out_path,
-                           &out_uri);
+                            path,
+                            &out_path,
+                            &out_uri);
        g_assert_false (g_file_test (out_path, G_FILE_TEST_EXISTS));
        g_free (out_path);
        g_free (out_uri);
 
+       /* Creates media-art cache dir if it doesn't exist ... */
        process = media_art_process_new (&error);
        g_assert_no_error (error);
        g_assert_nonnull (process);
 
+       dir = g_build_filename (g_get_user_cache_dir (), "media-art", NULL);
+       g_assert_true (g_file_test (dir, G_FILE_TEST_EXISTS));
+       g_free (dir);
+
        ml = g_main_loop_new (NULL, FALSE);
 
        /* Process data */


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