diff options
author | NRK <nrk@disroot.org> | 2024-06-20 12:50:19 +0200 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2024-06-20 12:50:19 +0200 |
commit | 0620d473c2df34d02137fb22c23fb0f166b0e1a1 (patch) | |
tree | a20656575eb726cc62d9736a28f78d6ce581a39f /nsxiv.h | |
parent | 9b8cdcff482a518c24d31ce74524543bb7015102 (diff) | |
download | nsxiv-0620d473c2df34d02137fb22c23fb0f166b0e1a1.tar.zst |
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
Diffstat (limited to 'nsxiv.h')
-rw-r--r-- | nsxiv.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |