diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-12-28 00:26:36 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-12-28 02:07:42 +0100 |
commit | ad1ff06aff068bb260c0b957c5257acb1d117caf (patch) | |
tree | 6ca557fb3eabfd5747b6bae82f25531ecdab8dad /fiv-browser.c | |
parent | af2eb411d92028b50f5b54b4b69bbc73cc0cae34 (diff) | |
download | fiv-ad1ff06aff068bb260c0b957c5257acb1d117caf.tar.gz fiv-ad1ff06aff068bb260c0b957c5257acb1d117caf.tar.xz fiv-ad1ff06aff068bb260c0b957c5257acb1d117caf.zip |
Avoid producing thumbnails of thumbnails
Diffstat (limited to 'fiv-browser.c')
-rw-r--r-- | fiv-browser.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fiv-browser.c b/fiv-browser.c index b85caeb..ab085f7 100644 --- a/fiv-browser.c +++ b/fiv-browser.c @@ -543,6 +543,17 @@ thumbnailer_start(FivBrowser *self) { thumbnailer_abort(self); + // TODO(p): Leave out all paths containing .cache/thumbnails altogether. + gchar *thumbnails_dir = fiv_io_get_thumbnail_root(); + GFile *thumbnails = g_file_new_for_path(thumbnails_dir); + g_free(thumbnails_dir); + GFile *current = g_file_new_for_path(self->path); + gboolean is_a_thumbnail = g_file_has_prefix(current, thumbnails); + g_object_unref(current); + g_object_unref(thumbnails); + if (is_a_thumbnail) + return; + GList *missing = NULL, *lq = NULL; for (guint i = self->entries->len; i--; ) { Entry *entry = &g_array_index(self->entries, Entry, i); |