fix rardar
This commit is contained in:
parent
ac9dbb5239
commit
03beb80273
@ -241,10 +241,7 @@ async def arr_movie_lookup(apikey: str, term: str, db: Session = Depends(get_db)
|
|||||||
hasFile=False,
|
hasFile=False,
|
||||||
)]
|
)]
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
return []
|
||||||
status_code=404,
|
|
||||||
detail="未找到该电影!"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@arr_router.get("/movie/{mid}", response_model=schemas.RadarrMovie)
|
@arr_router.get("/movie/{mid}", response_model=schemas.RadarrMovie)
|
||||||
@ -277,8 +274,8 @@ async def arr_movie(apikey: str, mid: int, db: Session = Depends(get_db)) -> Any
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@arr_router.put("/movie", response_model=schemas.Response)
|
@arr_router.post("/movie", response_model=schemas.Response)
|
||||||
async def arr_add_movie(apikey: str, title: str, tmdbId: int, year: str) -> Any:
|
async def arr_add_movie(apikey: str, movie: RadarrMovie) -> Any:
|
||||||
"""
|
"""
|
||||||
新增Rardar电影订阅
|
新增Rardar电影订阅
|
||||||
"""
|
"""
|
||||||
@ -287,7 +284,10 @@ async def arr_add_movie(apikey: str, title: str, tmdbId: int, year: str) -> Any:
|
|||||||
status_code=403,
|
status_code=403,
|
||||||
detail="认证失败!",
|
detail="认证失败!",
|
||||||
)
|
)
|
||||||
if SubscribeChain().process(title=title, year=year, mtype=MediaType.MOVIE, tmdbid=tmdbId):
|
if SubscribeChain().process(title=movie.title,
|
||||||
|
year=str(movie.year) if movie.year else None,
|
||||||
|
mtype=MediaType.MOVIE,
|
||||||
|
tmdbid=movie.tmdbId):
|
||||||
return {"success": True, "msg": "添加订阅成功!"}
|
return {"success": True, "msg": "添加订阅成功!"}
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
@ -3,8 +3,9 @@ from pydantic import BaseModel
|
|||||||
|
|
||||||
|
|
||||||
class RadarrMovie(BaseModel):
|
class RadarrMovie(BaseModel):
|
||||||
id: int
|
id: Optional[int]
|
||||||
title: str
|
title: str
|
||||||
|
year: Optional[int]
|
||||||
isAvailable: bool
|
isAvailable: bool
|
||||||
monitored: bool
|
monitored: bool
|
||||||
tmdbId: Optional[int]
|
tmdbId: Optional[int]
|
||||||
@ -19,6 +20,7 @@ class RadarrMovie(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class SonarrSeries(BaseModel):
|
class SonarrSeries(BaseModel):
|
||||||
|
id: Optional[int]
|
||||||
title: str
|
title: str
|
||||||
sortTitle: Optional[str]
|
sortTitle: Optional[str]
|
||||||
seasonCount: Optional[int]
|
seasonCount: Optional[int]
|
||||||
@ -29,7 +31,7 @@ class SonarrSeries(BaseModel):
|
|||||||
images: Optional[list]
|
images: Optional[list]
|
||||||
remotePoster: Optional[str]
|
remotePoster: Optional[str]
|
||||||
seasons: Optional[list]
|
seasons: Optional[list]
|
||||||
year: int
|
year: Optional[int]
|
||||||
path: Optional[str]
|
path: Optional[str]
|
||||||
profileId: Optional[int]
|
profileId: Optional[int]
|
||||||
languageProfileId: Optional[int]
|
languageProfileId: Optional[int]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user