mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-19 21:27:43 +08:00
Check if Sonarr return an 'episodeFile' key for each episode with 'hasFile' = True to fix #73
This commit is contained in:
parent
dc562709e6
commit
ff00f4a083
1 changed files with 9 additions and 7 deletions
|
@ -32,7 +32,9 @@ def sync_episodes():
|
||||||
url_sonarr_api_episode = url_sonarr + "/api/episode?seriesId=" + str(seriesId[0]) + "&apikey=" + apikey_sonarr
|
url_sonarr_api_episode = url_sonarr + "/api/episode?seriesId=" + str(seriesId[0]) + "&apikey=" + apikey_sonarr
|
||||||
r = requests.get(url_sonarr_api_episode)
|
r = requests.get(url_sonarr_api_episode)
|
||||||
for episode in r.json():
|
for episode in r.json():
|
||||||
if episode['hasFile'] and episode['episodeFile']['size'] > 20480:
|
if episode['hasFile'] is True:
|
||||||
|
if 'episodeFile' in episode:
|
||||||
|
if episode['episodeFile']['size'] > 20480:
|
||||||
# Add shows in Sonarr to current shows list
|
# Add shows in Sonarr to current shows list
|
||||||
if 'sceneName' in episode['episodeFile']:
|
if 'sceneName' in episode['episodeFile']:
|
||||||
sceneName = episode['episodeFile']['sceneName']
|
sceneName = episode['episodeFile']['sceneName']
|
||||||
|
|
Loading…
Reference in a new issue