@ -14,7 +14,7 @@ cli = Typer()
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
def run_app(
|
def run_app(
|
||||||
host: str = "::",
|
host: str = "0.0.0.0",
|
||||||
port: int = 8000,
|
port: int = 8000,
|
||||||
anime_dir: Optional[Path] = Argument(None, help="Directory where anime is stored."),
|
anime_dir: Optional[Path] = Argument(None, help="Directory where anime is stored."),
|
||||||
):
|
):
|
||||||
@ -35,7 +35,7 @@ def run_app(
|
|||||||
)
|
)
|
||||||
app.state.anime_dir = anime_dir
|
app.state.anime_dir = anime_dir
|
||||||
|
|
||||||
uvicorn.run(app, host=host, port=port)
|
uvicorn.run(app, host=host, port=port, workers=1)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -2,6 +2,7 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import copytree, rmtree
|
from shutil import copytree, rmtree
|
||||||
|
|
||||||
|
|
||||||
CURRENT_DIR = Path(__file__).parent
|
CURRENT_DIR = Path(__file__).parent
|
||||||
STATIC_OUTPUT_DIR = CURRENT_DIR / "anime/static"
|
STATIC_OUTPUT_DIR = CURRENT_DIR / "anime/static"
|
||||||
FRONTEND_DIR = CURRENT_DIR / "frontend"
|
FRONTEND_DIR = CURRENT_DIR / "frontend"
|
||||||
@ -21,7 +22,7 @@ class DirChanger:
|
|||||||
os.chdir(CURRENT_DIR)
|
os.chdir(CURRENT_DIR)
|
||||||
|
|
||||||
|
|
||||||
def build():
|
def build(setup_kwargs):
|
||||||
"""
|
"""
|
||||||
Build frontend and copy it to the static directory.
|
Build frontend and copy it to the static directory.
|
||||||
|
|
||||||
@ -38,6 +39,8 @@ def build():
|
|||||||
rmtree(STATIC_OUTPUT_DIR, ignore_errors=True)
|
rmtree(STATIC_OUTPUT_DIR, ignore_errors=True)
|
||||||
copytree(symlinks=True, src=DIST_DIR, dst=STATIC_OUTPUT_DIR)
|
copytree(symlinks=True, src=DIST_DIR, dst=STATIC_OUTPUT_DIR)
|
||||||
|
|
||||||
|
return setup_kwargs
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
build()
|
build({})
|
@ -24,7 +24,7 @@ async function startWatching() {
|
|||||||
<Space fill direction="vertical" :size="20">
|
<Space fill direction="vertical" :size="20">
|
||||||
<Button type="warning" round size="large" @click="kill('mpv')">Убить MPV</Button>
|
<Button type="warning" round size="large" @click="kill('mpv')">Убить MPV</Button>
|
||||||
<Button type="danger" round size="large" @click="kill('awatch', 'mpv')">Убить awatch</Button>
|
<Button type="danger" round size="large" @click="kill('awatch', 'mpv')">Убить awatch</Button>
|
||||||
<Button type="primary" round size="large" :disabled="!can_watch">Начать потребление анимы</Button>
|
<Button type="primary" round size="large" :disabled="!can_watch" @click="startWatching">Начать потребление анимы</Button>
|
||||||
</Space>
|
</Space>
|
||||||
<PlayerComponent />
|
<PlayerComponent />
|
||||||
</template>
|
</template>
|
||||||
|
@ -4,6 +4,7 @@ version = "0.1.0"
|
|||||||
description = ""
|
description = ""
|
||||||
authors = ["Pavel Kirilin <win10@list.ru>"]
|
authors = ["Pavel Kirilin <win10@list.ru>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
include = ["anime/static/**/*"]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.11"
|
python = "^3.11"
|
||||||
@ -16,7 +17,7 @@ anime = "anime.__main__:main"
|
|||||||
|
|
||||||
[tool.poetry.build]
|
[tool.poetry.build]
|
||||||
generate-setup-file = false
|
generate-setup-file = false
|
||||||
script = "pre_build.py"
|
script = "build.py"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
Reference in New Issue
Block a user