mirror of
https://github.com/9001/copyparty.git
synced 2025-11-24 07:23:22 -07:00
support thumbnail pregen for all output formats
This commit is contained in:
parent
77f74ddb2f
commit
a359b89edd
|
|
@ -124,7 +124,17 @@ from .util import (
|
||||||
|
|
||||||
if True: # pylint: disable=using-constant-test
|
if True: # pylint: disable=using-constant-test
|
||||||
import typing
|
import typing
|
||||||
from typing import Any, Generator, Iterable, Match, Optional, Pattern, Type, Union
|
from typing import (
|
||||||
|
Any,
|
||||||
|
Generator,
|
||||||
|
Iterable,
|
||||||
|
Match,
|
||||||
|
Optional,
|
||||||
|
Pattern,
|
||||||
|
Sequence,
|
||||||
|
Type,
|
||||||
|
Union,
|
||||||
|
)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .httpconn import HttpConn
|
from .httpconn import HttpConn
|
||||||
|
|
@ -172,6 +182,18 @@ PERMS_rwh = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def _build_zip_xcode() -> Sequence[str]:
|
||||||
|
ret = "opus mp3 flac wav p".split()
|
||||||
|
for codec in ("w", "j"):
|
||||||
|
for suf in ("", "f", "f3", "3"):
|
||||||
|
ret.append("%s%s" % (codec, suf))
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
ZIP_XCODE_L = _build_zip_xcode()
|
||||||
|
ZIP_XCODE_S = set(ZIP_XCODE_L)
|
||||||
|
|
||||||
|
|
||||||
class HttpCli(object):
|
class HttpCli(object):
|
||||||
"""
|
"""
|
||||||
Spawned by HttpConn to process one http transaction
|
Spawned by HttpConn to process one http transaction
|
||||||
|
|
@ -4942,8 +4964,11 @@ class HttpCli(object):
|
||||||
# for f in fgen: print(repr({k: f[k] for k in ["vp", "ap"]}))
|
# for f in fgen: print(repr({k: f[k] for k in ["vp", "ap"]}))
|
||||||
cfmt = ""
|
cfmt = ""
|
||||||
if self.thumbcli and not self.args.no_bacode:
|
if self.thumbcli and not self.args.no_bacode:
|
||||||
for zs in ("opus", "mp3", "flac", "wav", "w", "j", "p"):
|
if uarg in ZIP_XCODE_S:
|
||||||
if zs in self.ouparam or uarg == zs:
|
cfmt = uarg
|
||||||
|
else:
|
||||||
|
for zs in ZIP_XCODE_L:
|
||||||
|
if zs in self.ouparam:
|
||||||
cfmt = zs
|
cfmt = zs
|
||||||
|
|
||||||
if cfmt:
|
if cfmt:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue