Revert "feat(recommend): add semaphore to limit concurrent requests"

This reverts commit 33de1c3618.
This commit is contained in:
InfinityPacer
2024-12-23 10:29:37 +08:00
parent 33de1c3618
commit 544119c49f
2 changed files with 46 additions and 58 deletions
+1 -7
View File
@@ -1,4 +1,3 @@
import asyncio
from typing import Any, List, Dict
from fastapi import APIRouter, Depends
@@ -43,12 +42,8 @@ def play_item(itemid: str, _: schemas.TokenPayload = Depends(verify_token)) -> s
return schemas.Response(success=False, message="未找到播放地址")
# 控制最大并发数
semaphore = asyncio.Semaphore(10)
@router.get("/exists", summary="查询本地是否存在(数据库)", response_model=schemas.Response)
async def exists_local(title: str = None,
def exists_local(title: str = None,
year: int = None,
mtype: str = None,
tmdbid: int = None,
@@ -58,7 +53,6 @@ async def exists_local(title: str = None,
"""
判断本地是否存在
"""
async with semaphore:
meta = MetaInfo(title)
if not season:
season = meta.begin_season
+1 -7
View File
@@ -1,4 +1,3 @@
import asyncio
from typing import List, Any
import cn2an
@@ -147,12 +146,8 @@ def update_subscribe_status(
return schemas.Response(success=True)
# 控制最大并发数
semaphore = asyncio.Semaphore(10)
@router.get("/media/{mediaid}", summary="查询订阅", response_model=schemas.Subscribe)
async def subscribe_mediaid(
def subscribe_mediaid(
mediaid: str,
season: int = None,
title: str = None,
@@ -161,7 +156,6 @@ async def subscribe_mediaid(
"""
根据 TMDBID/豆瓣ID/BangumiId 查询订阅 tmdb:/douban:
"""
async with semaphore:
result = None
title_check = False
if mediaid.startswith("tmdb:"):