[gnome-software: 4/9] odrs-provider: Ignore GS_DOWNLOAD_ERROR_NOT_MODIFIED




commit b2834bb414da93f279c966a679732d9bc4507b9f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Sep 12 14:08:27 2022 -0300

    odrs-provider: Ignore GS_DOWNLOAD_ERROR_NOT_MODIFIED
    
    That means we have the most recent file already, which is an error
    that can safely be ignored.

 lib/gs-odrs-provider.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-odrs-provider.c b/lib/gs-odrs-provider.c
index 8d431dda7..e117de282 100644
--- a/lib/gs-odrs-provider.c
+++ b/lib/gs-odrs-provider.c
@@ -1417,13 +1417,16 @@ download_ratings_cb (GObject      *source_object,
        const gchar *cache_file_path = NULL;
        g_autoptr(GError) local_error = NULL;
 
-       if (!gs_download_file_finish (soup_session, result, &local_error)) {
+       if (!gs_download_file_finish (soup_session, result, &local_error) &&
+           !g_error_matches (local_error, GS_DOWNLOAD_ERROR, GS_DOWNLOAD_ERROR_NOT_MODIFIED)) {
                g_task_return_new_error (task, GS_ODRS_PROVIDER_ERROR,
                                         GS_ODRS_PROVIDER_ERROR_DOWNLOADING,
                                         "%s", local_error->message);
                return;
        }
 
+       g_clear_error (&local_error);
+
        cache_file_path = g_file_peek_path (cache_file);
        if (!gs_odrs_provider_load_ratings (self, cache_file_path, &local_error)) {
                g_debug ("Failed to load cache file ā€˜%sā€™, deleting it", cache_file_path);


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