Compare commits
No commits in common. "20a5c66e77edbe4fa820697f114f959e8b84d171" and "4060a582d61606d75f65ecd4d53b491c5b7fd740" have entirely different histories.
20a5c66e77
...
4060a582d6
@ -17,9 +17,6 @@ from sanic.log import logger
|
|||||||
|
|
||||||
from cista import config
|
from cista import config
|
||||||
from cista.util.filename import sanitize
|
from cista.util.filename import sanitize
|
||||||
import pillow_heif
|
|
||||||
|
|
||||||
pillow_heif.register_heif_opener()
|
|
||||||
|
|
||||||
bp = Blueprint("preview", url_prefix="/preview")
|
bp = Blueprint("preview", url_prefix="/preview")
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ const video = () => ['mkv', 'mp4', 'webm', 'mov', 'avi'].includes(props.doc.ext)
|
|||||||
const audio = () => ['mp3', 'flac', 'ogg', 'aac'].includes(props.doc.ext)
|
const audio = () => ['mp3', 'flac', 'ogg', 'aac'].includes(props.doc.ext)
|
||||||
const archive = () => ['zip', 'tar', 'gz', 'bz2', 'xz', '7z', 'rar'].includes(props.doc.ext)
|
const archive = () => ['zip', 'tar', 'gz', 'bz2', 'xz', '7z', 'rar'].includes(props.doc.ext)
|
||||||
const preview = () => (
|
const preview = () => (
|
||||||
['bmp', 'ico', 'tif', 'tiff', 'heic', 'heif', 'pdf', 'epub', 'mobi'].includes(props.doc.ext) ||
|
['bmp', 'ico', 'tif', 'tiff', 'pdf'].includes(props.doc.ext) ||
|
||||||
props.doc.size > 500000 &&
|
props.doc.size > 500000 &&
|
||||||
['avif', 'webp', 'png', 'jpg', 'jpeg'].includes(props.doc.ext)
|
['avif', 'webp', 'png', 'jpg', 'jpeg'].includes(props.doc.ext)
|
||||||
)
|
)
|
||||||
|
@ -24,7 +24,6 @@ dependencies = [
|
|||||||
"natsort",
|
"natsort",
|
||||||
"pathvalidate",
|
"pathvalidate",
|
||||||
"pillow",
|
"pillow",
|
||||||
"pillow-heif>=1.1.0",
|
|
||||||
"pyjwt",
|
"pyjwt",
|
||||||
"pymupdf",
|
"pymupdf",
|
||||||
"sanic",
|
"sanic",
|
||||||
|
@ -11,27 +11,17 @@ class CustomBuildHook(BuildHookInterface):
|
|||||||
def initialize(self, version, build_data):
|
def initialize(self, version, build_data):
|
||||||
super().initialize(version, build_data)
|
super().initialize(version, build_data)
|
||||||
stderr.write(">>> Building Cista frontend\n")
|
stderr.write(">>> Building Cista frontend\n")
|
||||||
npm = None
|
|
||||||
bun = shutil.which("bun")
|
|
||||||
if bun is None:
|
|
||||||
npm = shutil.which("npm")
|
npm = shutil.which("npm")
|
||||||
if npm is None:
|
if npm is None:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Bun or NodeJS `npm` is required for building but neither was found\n Visit https://bun.com/"
|
"NodeJS `npm` is required for building Cista but it was not found"
|
||||||
)
|
)
|
||||||
# npm --prefix doesn't work on Windows, so we chdir instead
|
# npm --prefix doesn't work on Windows, so we chdir instead
|
||||||
os.chdir("frontend")
|
os.chdir("frontend")
|
||||||
try:
|
try:
|
||||||
if npm:
|
|
||||||
stderr.write("### npm install\n")
|
stderr.write("### npm install\n")
|
||||||
subprocess.run([npm, "install"], check=True) # noqa: S603
|
subprocess.run([npm, "install"], check=True) # noqa: S603
|
||||||
stderr.write("\n### npm run build\n")
|
stderr.write("\n### npm run build\n")
|
||||||
subprocess.run([npm, "run", "build"], check=True) # noqa: S603
|
subprocess.run([npm, "run", "build"], check=True) # noqa: S603
|
||||||
else:
|
|
||||||
assert bun
|
|
||||||
stderr.write("### bun install\n")
|
|
||||||
subprocess.run([bun, "install"], check=True) # noqa: S603
|
|
||||||
stderr.write("\n### bun run build\n")
|
|
||||||
subprocess.run([bun, "run", "build"], check=True) # noqa: S603
|
|
||||||
finally:
|
finally:
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user