fix sonarr
This commit is contained in:
parent
713d3d6a87
commit
ec9d07d343
@ -1,6 +1,6 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
from fastapi import APIRouter, HTTPException, Depends, Request
|
from fastapi import APIRouter, HTTPException, Depends
|
||||||
from requests import Session
|
from requests import Session
|
||||||
|
|
||||||
from app import schemas
|
from app import schemas
|
||||||
@ -9,7 +9,6 @@ from app.chain.subscribe import SubscribeChain
|
|||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.db import get_db
|
from app.db import get_db
|
||||||
from app.db.models.subscribe import Subscribe
|
from app.db.models.subscribe import Subscribe
|
||||||
from app.log import logger
|
|
||||||
from app.schemas import RadarrMovie, SonarrSeries
|
from app.schemas import RadarrMovie, SonarrSeries
|
||||||
from app.utils.types import MediaType
|
from app.utils.types import MediaType
|
||||||
from version import APP_VERSION
|
from version import APP_VERSION
|
||||||
@ -541,7 +540,7 @@ async def arr_serie(apikey: str, tid: int, db: Session = Depends(get_db)) -> Any
|
|||||||
|
|
||||||
|
|
||||||
@arr_router.post("/series")
|
@arr_router.post("/series")
|
||||||
async def arr_add_series(request: Request, apikey: str, tv: schemas.SonarrSeries) -> Any:
|
async def arr_add_series(apikey: str, tv: schemas.SonarrSeries) -> Any:
|
||||||
"""
|
"""
|
||||||
新增Sonarr剧集订阅
|
新增Sonarr剧集订阅
|
||||||
"""
|
"""
|
||||||
@ -550,9 +549,10 @@ async def arr_add_series(request: Request, apikey: str, tv: schemas.SonarrSeries
|
|||||||
status_code=403,
|
status_code=403,
|
||||||
detail="认证失败!",
|
detail="认证失败!",
|
||||||
)
|
)
|
||||||
logger.info(await request.body())
|
|
||||||
sid = 0
|
sid = 0
|
||||||
for season in tv.seasons:
|
for season in tv.seasons:
|
||||||
|
if not season.get("monitored"):
|
||||||
|
continue
|
||||||
sid = SubscribeChain().process(title=tv.title,
|
sid = SubscribeChain().process(title=tv.title,
|
||||||
year=str(tv.year) if tv.year else None,
|
year=str(tv.year) if tv.year else None,
|
||||||
season=season.get("seasonNumber"),
|
season=season.get("seasonNumber"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user