mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: make model sessions explicit
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
"""把旧整理历史 Oper 的业务写入方法转交给应用服务。"""
|
||||
|
||||
from typing import Optional
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.application.history import add_transfer_fail, add_transfer_success
|
||||
from app.db.models.transferhistory import TransferHistory
|
||||
from app.db.oper.transferhistory import TransferHistoryOper as CanonicalTransferHistoryOper
|
||||
from app.domain.context import MediaInfo, MusicInfo
|
||||
from app.domain.meta.metabase import MetaBase
|
||||
@@ -23,7 +22,7 @@ class TransferHistoryOper(CanonicalTransferHistoryOper):
|
||||
transferinfo: TransferInfo,
|
||||
downloader: Optional[str] = None,
|
||||
download_hash: Optional[str] = None,
|
||||
) -> Optional[TransferHistory]:
|
||||
) -> Optional[Any]:
|
||||
"""
|
||||
按旧签名新增整理成功历史。
|
||||
|
||||
@@ -49,7 +48,7 @@ class TransferHistoryOper(CanonicalTransferHistoryOper):
|
||||
transferinfo: Optional[TransferInfo] = None,
|
||||
downloader: Optional[str] = None,
|
||||
download_hash: Optional[str] = None,
|
||||
) -> Optional[TransferHistory]:
|
||||
) -> Optional[Any]:
|
||||
"""
|
||||
按旧签名新增整理失败历史。
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.application.subscription.write import add_subscribe, async_add_subscribe
|
||||
from app.db.models.subscribe import Subscribe
|
||||
from app.db.oper.subscribe import SubscribeOper as CanonicalSubscribeOper
|
||||
from app.domain.context import MediaInfo, MusicInfo
|
||||
|
||||
@@ -72,4 +71,4 @@ class SubscribeOper(CanonicalSubscribeOper):
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["Subscribe", "SubscribeOper"]
|
||||
__all__ = ["SubscribeOper"]
|
||||
|
||||
@@ -11,12 +11,10 @@ from app.api.deps import (
|
||||
get_current_user_async,
|
||||
)
|
||||
from app.db.oper.user import UserOper
|
||||
from app.db.models.user import User
|
||||
|
||||
|
||||
__all__ = [
|
||||
"UserOper",
|
||||
"User",
|
||||
"get_current_active_manage_user",
|
||||
"get_current_active_manage_user_async",
|
||||
"get_current_active_superuser",
|
||||
|
||||
Reference in New Issue
Block a user