Skip to content

Commit

Permalink
tmdbId is available in movie data
Browse files Browse the repository at this point in the history
  • Loading branch information
danielx committed Oct 20, 2024
1 parent 8c9dc9f commit 2d9b67a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/api_v1/endpoints/radarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def radarr(event: schemas.RadarrEvent):
MESSAGE.substitute(
title=event.movie.title.strip(),
year=event.movie.year,
id=event.remoteMovie.tmdbId,
id=event.movie.tmdbId,
)
)

Expand Down
4 changes: 0 additions & 4 deletions app/schemas/_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
class Movie(BaseModel):
title: str
year: int


class RemoteMovie(BaseModel):
tmdbId: int


class RadarrEvent(BaseModel):
eventType: str

movie: Movie
remoteMovie: RemoteMovie


class Series(BaseModel):
Expand Down
6 changes: 2 additions & 4 deletions tests/test_radarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class Payload(NamedTuple):
)
json: dict | None = {
"eventType": "Grab",
"movie": {"title": "string", "year": 0},
"remoteMovie": {"tmdbId": 0},
"movie": {"title": "string", "year": 0, "tmdbId": 0},
}


Expand All @@ -48,8 +47,7 @@ class Result(NamedTuple):
Payload(
json={
"eventType": "Download",
"movie": {"title": "string", "year": 0},
"remoteMovie": {"tmdbId": 0},
"movie": {"title": "string", "year": 0, "tmdbId": 0},
}
),
Result(
Expand Down

0 comments on commit 2d9b67a

Please sign in to comment.