From 4e60171c2d4a92866b468eb5657f17204d1593d3 Mon Sep 17 00:00:00 2001 From: Steven Marks Date: Thu, 4 Apr 2024 21:27:47 +0000 Subject: [PATCH] fix: Overseer API has inconsistant api, amend spokenLanguage model to match --- asyncpow/models/common.py | 12 +++++++++++- asyncpow/models/movie.py | 4 ++-- asyncpow/models/tv.py | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/asyncpow/models/common.py b/asyncpow/models/common.py index 59c1641..cff67ea 100644 --- a/asyncpow/models/common.py +++ b/asyncpow/models/common.py @@ -101,7 +101,7 @@ class GenreModel(BaseModel): name: str -class SpokenLanguagesModel(BaseModel): +class SpokenLanguagesModelTv(BaseModel): """ Data class representing a spoken language. """ @@ -111,6 +111,16 @@ class SpokenLanguagesModel(BaseModel): name: str +class SpokenLanguagesModelMovie(BaseModel): + """ + Data class representing a spoken language. + """ + + english_name: str + iso_639_1: str + name: str + + class ExternalIdsModel(BaseModel): """ Data class representing external IDs. diff --git a/asyncpow/models/movie.py b/asyncpow/models/movie.py index fd379b4..1cf56d8 100644 --- a/asyncpow/models/movie.py +++ b/asyncpow/models/movie.py @@ -32,7 +32,7 @@ KeywordModel, ProductionCompanyModel, ProductionCountryModel, - SpokenLanguagesModel, + SpokenLanguagesModelMovie, WatchProviderModel, ) @@ -161,7 +161,7 @@ class MovieDetailsModel(BaseModel): releases: dict revenue: int runtime: int - spokenLanguages: list[SpokenLanguagesModel] + spokenLanguages: list[SpokenLanguagesModelMovie] status: str tagline: str title: str diff --git a/asyncpow/models/tv.py b/asyncpow/models/tv.py index e9ad5d5..9721fd8 100644 --- a/asyncpow/models/tv.py +++ b/asyncpow/models/tv.py @@ -30,7 +30,7 @@ KeywordModel, ProductionCompanyModel, ProductionCountryModel, - SpokenLanguagesModel, + SpokenLanguagesModelTv, WatchProviderModel, ) @@ -100,7 +100,7 @@ class TvDetailsModel(BaseModel): popularity: float productionCompanies: list[ProductionCompanyModel] productionCountries: list[ProductionCountryModel] - spokenLanguages: list[SpokenLanguagesModel] + spokenLanguages: list[SpokenLanguagesModelTv] seasons: list[SeasonModel] status: str tagline: str