diff --git a/README.md b/README.md index 5e22694c..822cd033 100644 --- a/README.md +++ b/README.md @@ -405,6 +405,7 @@ press `g` to toggle grid-view instead of the file listing, and `t` toggles icon it does static images with Pillow / pyvips / FFmpeg, and uses FFmpeg for video files, so you may want to `--no-thumb` or maybe just `--no-vthumb` depending on how dangerous your users are * pyvips is 3x faster than Pillow, Pillow is 3x faster than FFmpeg +* disable thumbnails for specific volumes with volflag `dthumb` for all, or `dvthumb` / `dathumb` / `dithumb` for video/audio/images only audio files are covnerted into spectrograms using FFmpeg unless you `--no-athumb` (and some FFmpeg builds may need `--th-ff-swr`) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 962316ec..156fbee4 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -875,6 +875,17 @@ class AuthSrv(object): vol.flags["html_head"] = "\n".join([x for x in h if x]) + for vol in vfs.all_vols.values(): + if self.args.no_vthumb: + vol.flags["dvthumb"] = True + if self.args.no_athumb: + vol.flags["dathumb"] = True + if self.args.no_thumb or vol.flags.get("dthumb", False): + vol.flags["dthumb"] = True + vol.flags["dvthumb"] = True + vol.flags["dathumb"] = True + vol.flags["dithumb"] = True + for vol in vfs.all_vols.values(): fk = vol.flags.get("fk") if fk: diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index fd706cf1..34b82d7b 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2097,9 +2097,7 @@ class HttpCli(object): thp = None if self.thumbcli: - thp = self.thumbcli.get( - dbv.realpath, vrem, int(st.st_mtime), th_fmt - ) + thp = self.thumbcli.get(dbv, vrem, int(st.st_mtime), th_fmt) if thp: return self.tx_file(thp) diff --git a/copyparty/th_cli.py b/copyparty/th_cli.py index b2601f30..e8a18e0e 100644 --- a/copyparty/th_cli.py +++ b/copyparty/th_cli.py @@ -37,13 +37,14 @@ class ThumbCli(object): def log(self, msg, c=0): self.log_func("thumbcli", msg, c) - def get(self, ptop, rem, mtime, fmt): + def get(self, dbv, rem, mtime, fmt): + ptop = dbv.realpath ext = rem.rsplit(".")[-1].lower() - if ext not in self.thumbable: + if ext not in self.thumbable or "dthumb" in dbv.flags: return None is_vid = ext in self.fmt_ffv - if is_vid and self.args.no_vthumb: + if is_vid and "dvthumb" in dbv.flags: return None want_opus = fmt in ("opus", "caf") @@ -53,12 +54,14 @@ class ThumbCli(object): if self.args.no_acode: return None else: - if self.args.no_athumb: + if "dathumb" in dbv.flags: return None elif want_opus: return None is_img = not is_vid and not is_au + if is_img and "dithumb" in dbv.flags: + return None preferred = self.args.th_dec[0] if self.args.th_dec else ""