mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-05-11 18:11:05 +08:00
chore: 整理代码逻辑,留出下载字幕的入口
This commit is contained in:
20
entry.py
20
entry.py
@@ -4,7 +4,14 @@ import sys
|
||||
import uvloop
|
||||
from loguru import logger
|
||||
|
||||
from commands import recheck, refresh_tags, upper_thumb
|
||||
from commands import (
|
||||
recheck,
|
||||
refresh_nfo,
|
||||
refresh_poster,
|
||||
refresh_subtitle,
|
||||
refresh_upper,
|
||||
refresh_video,
|
||||
)
|
||||
from models import init_model
|
||||
from processor import cleanup, process
|
||||
from settings import settings
|
||||
@@ -14,12 +21,15 @@ asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||
|
||||
async def entry() -> None:
|
||||
await init_model()
|
||||
for command, func in [
|
||||
for command, func in (
|
||||
("once", process),
|
||||
("recheck", recheck),
|
||||
("upper_thumb", upper_thumb),
|
||||
("refresh_tags", refresh_tags),
|
||||
]:
|
||||
("refresh_poster", refresh_poster),
|
||||
("refresh_upper", refresh_upper),
|
||||
("refresh_nfo", refresh_nfo),
|
||||
("refresh_video", refresh_video),
|
||||
("refresh_subtitle", refresh_subtitle),
|
||||
):
|
||||
if any(command in _ for _ in sys.argv):
|
||||
logger.info("Running {}...", command)
|
||||
await func()
|
||||
|
||||
Reference in New Issue
Block a user