mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +08:00
refactor: 收口 V3 分层架构与插件兼容边界
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
|
||||
from app.db.base import DbOper
|
||||
from app.db.models.subscribehistory import SubscribeHistory
|
||||
@@ -24,3 +24,27 @@ class SubscribeHistoryOper(DbOper):
|
||||
page=page,
|
||||
count=count,
|
||||
)
|
||||
|
||||
async def async_list_by_type_and_username(
|
||||
self,
|
||||
mtype: str,
|
||||
username: str,
|
||||
page: int = 1,
|
||||
count: int = 30,
|
||||
) -> List[SubscribeHistory]:
|
||||
"""异步按媒体类型和用户分页查询订阅历史。"""
|
||||
return await SubscribeHistory.async_list_by_type_and_username(
|
||||
self._db,
|
||||
mtype=mtype,
|
||||
username=username,
|
||||
page=page,
|
||||
count=count,
|
||||
)
|
||||
|
||||
async def async_get(self, history_id: int) -> Optional[SubscribeHistory]:
|
||||
"""异步按 ID 查询订阅历史。"""
|
||||
return await SubscribeHistory.async_get(self._db, history_id)
|
||||
|
||||
async def async_delete(self, history_id: int) -> None:
|
||||
"""异步删除订阅历史。"""
|
||||
await SubscribeHistory.async_delete(self._db, history_id)
|
||||
|
||||
Reference in New Issue
Block a user