From 0620d473c2df34d02137fb22c23fb0f166b0e1a1 Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 20 Jun 2024 10:50:19 +0000 Subject: allow {white,black}listing thumbnail cache dirs (#461) this adds the cli flags --cache-{allow,deny} along with corresponding config.h vars which allows the user to control which directories will have thumbnail cache written. this is a more general version of the `cache-whitelist` patch that existed in the nsxiv-extra repo: https://codeberg.org/nsxiv/nsxiv-extra/src/commit/21cb27cee7/patches/cache-whitelist Closes: https://codeberg.org/nsxiv/nsxiv/issues/454 --- nsxiv.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index ccd1796..5dfbed3 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -270,6 +270,8 @@ struct opt { char *res_name; /* misc flags: */ + const char *tns_filters; + bool tns_filters_is_blacklist; bool quiet; bool thumb_mode; bool clean_cache; @@ -293,6 +295,12 @@ typedef struct { int y; } thumb_t; +typedef struct { + const char *path; + int len; + bool recursive; +} thumb_filter_t; + struct tns { fileinfo_t *files; thumb_t *thumbs; @@ -312,7 +320,11 @@ struct tns { int bw; int dim; + thumb_filter_t *filters; + int filters_cnt; + bool dirty; + bool filters_is_blacklist; }; void tns_clean_cache(void); -- cgit v1.2.3-54-g00ecf