mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-14 18:04:43 +08:00
Add another check for incorrect json returned by Sonarr #101
This commit is contained in:
parent
ded4a43846
commit
8825a83c95
1 changed files with 14 additions and 13 deletions
|
@ -8,15 +8,15 @@ from list_subtitles import *
|
||||||
|
|
||||||
def update_all_episodes():
|
def update_all_episodes():
|
||||||
series_full_scan_subtitles()
|
series_full_scan_subtitles()
|
||||||
logging.info('All existing subtitles indexed from disk.')
|
logging.info('All existing episode subtitles indexed from disk.')
|
||||||
list_missing_subtitles()
|
list_missing_subtitles()
|
||||||
logging.info('All missing subtitles updated in database.')
|
logging.info('All missing episode subtitles updated in database.')
|
||||||
|
|
||||||
def update_all_movies():
|
def update_all_movies():
|
||||||
movies_full_scan_subtitles()
|
movies_full_scan_subtitles()
|
||||||
logging.info('All existing subtitles indexed from disk.')
|
logging.info('All existing movie subtitles indexed from disk.')
|
||||||
list_missing_subtitles()
|
list_missing_subtitles()
|
||||||
logging.info('All missing subtitles updated in database.')
|
logging.info('All missing movie subtitles updated in database.')
|
||||||
|
|
||||||
def sync_episodes():
|
def sync_episodes():
|
||||||
from get_sonarr_settings import get_sonarr_settings
|
from get_sonarr_settings import get_sonarr_settings
|
||||||
|
@ -38,6 +38,7 @@ 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 'hasFile' in episode:
|
||||||
if episode['hasFile'] is True:
|
if episode['hasFile'] is True:
|
||||||
if 'episodeFile' in episode:
|
if 'episodeFile' in episode:
|
||||||
if episode['episodeFile']['size'] > 20480:
|
if episode['episodeFile']['size'] > 20480:
|
||||||
|
|
Loading…
Reference in a new issue