From a28fbf25bcec03ae8cb8e6b22537883f78541d66 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sun, 20 Feb 2022 13:13:49 +0100 Subject: Implement wide thumbnail cache invalidation --- fiv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'fiv.c') diff --git a/fiv.c b/fiv.c index f85f830..6930479 100644 --- a/fiv.c +++ b/fiv.c @@ -1760,7 +1760,7 @@ int main(int argc, char *argv[]) { gboolean show_version = FALSE, show_supported_media_types = FALSE, - browse = FALSE; + invalidate_cache = FALSE, browse = FALSE; gchar **path_args = NULL, *thumbnail_size = NULL; const GOptionEntry options[] = { {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &path_args, @@ -1774,6 +1774,9 @@ main(int argc, char *argv[]) {"thumbnail", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &thumbnail_size, "Generate thumbnails for an image, up to the given size", "SIZE"}, + {"invalidate-cache", 0, G_OPTION_FLAG_IN_MAIN, + G_OPTION_ARG_NONE, &invalidate_cache, + "Invalidate the wide thumbnail cache", NULL}, {"version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &show_version, "Output version information and exit", NULL}, {}, @@ -1791,6 +1794,10 @@ main(int argc, char *argv[]) g_print("%s\n", *types++); return 0; } + if (invalidate_cache) { + fiv_thumbnail_invalidate(); + return 0; + } if (!initialized) exit_fatal("%s", error->message); -- cgit v1.2.3-70-g09d2