mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-27 12:00:32 +08:00
webui: update search card.
backend: update api url and rss manage api route.
This commit is contained in:
@@ -64,6 +64,23 @@ async def disable_rss(rss_id: int, current_user=Depends(get_current_user)):
|
||||
)
|
||||
|
||||
|
||||
@router.post(path="/disable/many", response_model=APIResponse)
|
||||
async def disable_many_rss(rss_ids: list[int], current_user=Depends(get_current_user)):
|
||||
if not current_user:
|
||||
raise UNAUTHORIZED
|
||||
with RSSEngine() as engine:
|
||||
if engine.disable_list(rss_ids):
|
||||
return JSONResponse(
|
||||
status_code=200,
|
||||
content={"msg_en": "Disable RSS successfully.", "msg_zh": "禁用 RSS 成功。"},
|
||||
)
|
||||
else:
|
||||
return JSONResponse(
|
||||
status_code=406,
|
||||
content={"msg_en": "Disable RSS failed.", "msg_zh": "禁用 RSS 失败。"},
|
||||
)
|
||||
|
||||
|
||||
@router.patch(path="/update/{rss_id}", response_model=APIResponse)
|
||||
async def update_rss(
|
||||
rss_id: int, data: RSSUpdate, current_user=Depends(get_current_user)
|
||||
|
||||
@@ -9,7 +9,7 @@ from module.models import Bangumi
|
||||
router = APIRouter(prefix="/search", tags=["search"])
|
||||
|
||||
|
||||
@router.get("/", response_model=list[Bangumi])
|
||||
@router.get("/bangumi", response_model=list[Bangumi])
|
||||
async def search_torrents(
|
||||
site: str = "mikan",
|
||||
keywords: str = Query(None),
|
||||
|
||||
@@ -59,6 +59,10 @@ class RSSEngine(Database):
|
||||
msg_zh="RSS 添加失败。",
|
||||
)
|
||||
|
||||
def disable_list(self, rss_id_list: list[int]):
|
||||
for rss_id in rss_id_list:
|
||||
self.rss.disable(rss_id)
|
||||
|
||||
def pull_rss(self, rss_item: RSSItem) -> list[Torrent]:
|
||||
torrents = self._get_torrents(rss_item)
|
||||
new_torrents = self.torrent.check_new(torrents)
|
||||
|
||||
Reference in New Issue
Block a user