aboutsummaryrefslogtreecommitdiff
path: root/fiv.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-02-20 13:13:49 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-02-20 15:44:42 +0100
commita28fbf25bcec03ae8cb8e6b22537883f78541d66 (patch)
treeed88ed07de49c496df933f63942bc4f1bd8f4d8d /fiv.c
parent6c748439ed0274d844c7634f0d60f872e3008630 (diff)
downloadfiv-a28fbf25bcec03ae8cb8e6b22537883f78541d66.tar.gz
fiv-a28fbf25bcec03ae8cb8e6b22537883f78541d66.tar.xz
fiv-a28fbf25bcec03ae8cb8e6b22537883f78541d66.zip
Implement wide thumbnail cache invalidation
Diffstat (limited to 'fiv.c')
-rw-r--r--fiv.c9
1 files changed, 8 insertions, 1 deletions
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);