This commit is contained in:
ed 2024-05-31 08:57:33 +00:00
parent 5919607ad0
commit ac1bc232a9
4 changed files with 13 additions and 8 deletions

View file

@ -111,7 +111,9 @@ class MParser(object):
raise Exception()
def au_unpk(log: "NamedLogger", fmt_map: dict[str, str], abspath: str, vn: Optional[VFS] = None) -> str:
def au_unpk(
log: "NamedLogger", fmt_map: dict[str, str], abspath: str, vn: Optional[VFS] = None
) -> str:
ret = ""
try:
ext = abspath.split(".")[-1].lower()

View file

@ -104,7 +104,9 @@ def enthumb(
return f
def errdesc(vfs: VFS, errors: list[tuple[str, str]]) -> tuple[dict[str, Any], list[str]]:
def errdesc(
vfs: VFS, errors: list[tuple[str, str]]
) -> tuple[dict[str, Any], list[str]]:
report = ["copyparty failed to add the following files to the archive:", ""]
for fn, err in errors:

View file

@ -599,13 +599,14 @@ class ThumbSrv(object):
b"pngquant",
b"--strip",
b"--nofs",
b"--output", fsenc(wtpath),
fsenc(tpath)
b"--output",
fsenc(wtpath),
fsenc(tpath),
]
ret = runcmd(cmd, timeout=vn.flags["convt"], nice=True, oom=400)[0]
if ret:
try:
wunlink(self.log, wtpath, vn.flags)
wunlink(self.log, wtpath, vn.flags)
except:
pass
else:
@ -803,8 +804,8 @@ class ThumbSrv(object):
for k, vs in raw_tags.items():
for v in vs:
if len(str(v)) >= 1024:
bv = (k + "=").encode("utf-8", "replace")
ret += [b"-metadata", bv]
bv = k.encode("utf-8", "replace")
ret += [b"-metadata", bv + b"="]
break
return ret