mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
option to disable thumbnails per volume
This commit is contained in:
parent
2dbed4500a
commit
9697fb3d84
|
@ -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
|
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
|
* 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`)
|
audio files are covnerted into spectrograms using FFmpeg unless you `--no-athumb` (and some FFmpeg builds may need `--th-ff-swr`)
|
||||||
|
|
||||||
|
|
|
@ -875,6 +875,17 @@ class AuthSrv(object):
|
||||||
|
|
||||||
vol.flags["html_head"] = "\n".join([x for x in h if x])
|
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():
|
for vol in vfs.all_vols.values():
|
||||||
fk = vol.flags.get("fk")
|
fk = vol.flags.get("fk")
|
||||||
if fk:
|
if fk:
|
||||||
|
|
|
@ -2097,9 +2097,7 @@ class HttpCli(object):
|
||||||
|
|
||||||
thp = None
|
thp = None
|
||||||
if self.thumbcli:
|
if self.thumbcli:
|
||||||
thp = self.thumbcli.get(
|
thp = self.thumbcli.get(dbv, vrem, int(st.st_mtime), th_fmt)
|
||||||
dbv.realpath, vrem, int(st.st_mtime), th_fmt
|
|
||||||
)
|
|
||||||
|
|
||||||
if thp:
|
if thp:
|
||||||
return self.tx_file(thp)
|
return self.tx_file(thp)
|
||||||
|
|
|
@ -37,13 +37,14 @@ class ThumbCli(object):
|
||||||
def log(self, msg, c=0):
|
def log(self, msg, c=0):
|
||||||
self.log_func("thumbcli", msg, c)
|
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()
|
ext = rem.rsplit(".")[-1].lower()
|
||||||
if ext not in self.thumbable:
|
if ext not in self.thumbable or "dthumb" in dbv.flags:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
is_vid = ext in self.fmt_ffv
|
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
|
return None
|
||||||
|
|
||||||
want_opus = fmt in ("opus", "caf")
|
want_opus = fmt in ("opus", "caf")
|
||||||
|
@ -53,12 +54,14 @@ class ThumbCli(object):
|
||||||
if self.args.no_acode:
|
if self.args.no_acode:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
if self.args.no_athumb:
|
if "dathumb" in dbv.flags:
|
||||||
return None
|
return None
|
||||||
elif want_opus:
|
elif want_opus:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
is_img = not is_vid and not is_au
|
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 ""
|
preferred = self.args.th_dec[0] if self.args.th_dec else ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue