ff
This commit is contained in:
@@ -329,13 +329,13 @@ def convert(ctx,
|
||||
|
||||
if context['tmdb']:
|
||||
|
||||
tmdbResult = tc.queryTmdb(currentShowDescriptor.getId(), mediaFileProperties.getSeason(), mediaFileProperties.getEpisode())
|
||||
tmdbEpisodeResult = tc.queryEpisode(currentShowDescriptor.getId(), mediaFileProperties.getSeason(), mediaFileProperties.getEpisode())
|
||||
|
||||
# click.echo(f"{tmdbResult}")
|
||||
# click.echo(f"{tmdbEpisodeResult}")
|
||||
|
||||
if tmdbResult:
|
||||
if tmdbEpisodeResult:
|
||||
fileBasename = tc.getEpisodeFileBasename(currentShowDescriptor.getFilenamePrefix(),
|
||||
tmdbResult['name'],
|
||||
tmdbEpisodeResult['name'],
|
||||
mediaFileProperties.getSeason(),
|
||||
mediaFileProperties.getEpisode(),
|
||||
currentShowDescriptor.getIndexSeasonDigits(),
|
||||
|
||||
@@ -228,7 +228,9 @@ class ShowDetailsScreen(Screen):
|
||||
with Grid():
|
||||
|
||||
# 1
|
||||
yield Static("Show" if not self.__showDescriptor is None else "New Show", id="toplabel", classes="five")
|
||||
yield Static("Show" if not self.__showDescriptor is None else "New Show", id="toplabel")
|
||||
yield Button("Identify", id="identify_button")
|
||||
yield Static(" ", classes="three")
|
||||
|
||||
# 2
|
||||
yield Static("ID")
|
||||
|
||||
@@ -14,8 +14,54 @@ class TmdbController():
|
||||
|
||||
self.tmdbLanguage = TmdbController.DEFAULT_LANGUAGE
|
||||
|
||||
def queryShow(self, showId):
|
||||
"""
|
||||
First level keys in the response object:
|
||||
adult bool
|
||||
backdrop_path str
|
||||
created_by []
|
||||
episode_run_time []
|
||||
first_air_date str YYYY-MM-DD
|
||||
genres []
|
||||
homepage str
|
||||
id int
|
||||
in_production bool
|
||||
languages []
|
||||
last_air_date str YYYY-MM-DD
|
||||
last_episode_to_air {}
|
||||
name str
|
||||
next_episode_to_air null
|
||||
networks []
|
||||
number_of_episodes int
|
||||
number_of_seasons int
|
||||
origin_country []
|
||||
original_language str
|
||||
original_name str
|
||||
overview str
|
||||
popularity float
|
||||
poster_path str
|
||||
production_companies []
|
||||
production_countries []
|
||||
seasons []
|
||||
spoken_languages []
|
||||
status str
|
||||
tagline str
|
||||
type str
|
||||
vote_average float
|
||||
vote_count int
|
||||
"""
|
||||
|
||||
def queryTmdb(self, showId, season, episode):
|
||||
urlParams = f"?language={self.tmdbLanguage}&api_key={self.__tmdbApiKey}"
|
||||
|
||||
tmdbUrl = f"https://api.themoviedb.org/3/tv/{showId}W{urlParams}"
|
||||
|
||||
#TODO Check for result
|
||||
try:
|
||||
return requests.get(tmdbUrl).json()
|
||||
except:
|
||||
return {}
|
||||
|
||||
def queryEpisode(self, showId, season, episode):
|
||||
"""
|
||||
First level keys in the response object:
|
||||
air_date str 'YYY-MM-DD'
|
||||
|
||||
Reference in New Issue
Block a user