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() 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 = "" ret = ""
try: try:
ext = abspath.split(".")[-1].lower() ext = abspath.split(".")[-1].lower()

View file

@ -104,7 +104,9 @@ def enthumb(
return f 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:", ""] report = ["copyparty failed to add the following files to the archive:", ""]
for fn, err in errors: for fn, err in errors:

View file

@ -106,7 +106,7 @@ class ThumbCli(object):
sfmt += "3" if "3" in fmt else "" sfmt += "3" if "3" in fmt else ""
fmt = sfmt fmt = sfmt
elif fmt[:1] == "p" and not is_au: elif fmt[:1] == "p" and not is_au:
t = "cannot thumbnail [%s]: png only allowed for waveforms" t = "cannot thumbnail [%s]: png only allowed for waveforms"
self.log(t % (rem), 6) self.log(t % (rem), 6)

View file

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