mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
black
This commit is contained in:
parent
5919607ad0
commit
ac1bc232a9
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue