mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
enforce thumbnail config serverside
This commit is contained in:
parent
7f1c992601
commit
58ae38c613
|
@ -78,16 +78,34 @@ class ThumbCli(object):
|
|||
if rem.startswith(".hist/th/") and rem.split(".")[-1] in ["webp", "jpg", "png"]:
|
||||
return os.path.join(ptop, rem)
|
||||
|
||||
if fmt == "j" and self.args.th_no_jpg:
|
||||
fmt = "w"
|
||||
if fmt[:1] in "jw":
|
||||
sfmt = fmt[:1]
|
||||
|
||||
if fmt == "w":
|
||||
if (
|
||||
self.args.th_no_webp
|
||||
or (is_img and not self.can_webp)
|
||||
or (self.args.th_ff_jpg and (not is_img or preferred == "ff"))
|
||||
):
|
||||
fmt = "j"
|
||||
if sfmt == "j" and self.args.th_no_jpg:
|
||||
sfmt = "w"
|
||||
|
||||
if sfmt == "w":
|
||||
if (
|
||||
self.args.th_no_webp
|
||||
or (is_img and not self.can_webp)
|
||||
or (self.args.th_ff_jpg and (not is_img or preferred == "ff"))
|
||||
):
|
||||
sfmt = "j"
|
||||
|
||||
vf_crop = dbv.flags["crop"]
|
||||
vf_th3x = dbv.flags["th3x"]
|
||||
|
||||
if "f" in vf_crop:
|
||||
sfmt += "f" if "n" in vf_crop else ""
|
||||
else:
|
||||
sfmt += "f" if "f" in fmt else ""
|
||||
|
||||
if "f" in vf_th3x:
|
||||
sfmt += "3" if "y" in vf_th3x else ""
|
||||
else:
|
||||
sfmt += "3" if "3" in fmt else ""
|
||||
|
||||
fmt = sfmt
|
||||
|
||||
histpath = self.asrv.vfs.histtab.get(ptop)
|
||||
if not histpath:
|
||||
|
|
|
@ -4944,7 +4944,7 @@ var thegrid = (function () {
|
|||
if (!dcrop.startsWith('f'))
|
||||
return r.setdirty();
|
||||
|
||||
r.crop = dcrop.startsWith('y');
|
||||
r.crop = dcrop.endsWith('y');
|
||||
bcfg_upd_ui('gridcrop', r.crop);
|
||||
if (r.crop != en)
|
||||
toast.warn(10, L.ul_btnlk);
|
||||
|
@ -4954,7 +4954,7 @@ var thegrid = (function () {
|
|||
if (!dth3x.startsWith('f'))
|
||||
return r.setdirty();
|
||||
|
||||
r.x3 = dth3x.startsWith('y');
|
||||
r.x3 = dth3x.endsWith('y');
|
||||
bcfg_upd_ui('grid3x', r.x3);
|
||||
if (r.x3 != en)
|
||||
toast.warn(10, L.ul_btnlk);
|
||||
|
|
Loading…
Reference in a new issue