mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-12 17:03:59 +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():
|
||||
series_full_scan_subtitles()
|
||||
logging.info('All existing subtitles indexed from disk.')
|
||||
logging.info('All existing episode subtitles indexed from disk.')
|
||||
list_missing_subtitles()
|
||||
logging.info('All missing subtitles updated in database.')
|
||||
logging.info('All missing episode subtitles updated in database.')
|
||||
|
||||
def update_all_movies():
|
||||
movies_full_scan_subtitles()
|
||||
logging.info('All existing subtitles indexed from disk.')
|
||||
logging.info('All existing movie subtitles indexed from disk.')
|
||||
list_missing_subtitles()
|
||||
logging.info('All missing subtitles updated in database.')
|
||||
logging.info('All missing movie subtitles updated in database.')
|
||||
|
||||
def sync_episodes():
|
||||
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
|
||||
r = requests.get(url_sonarr_api_episode)
|
||||
for episode in r.json():
|
||||
if 'hasFile' in episode:
|
||||
if episode['hasFile'] is True:
|
||||
if 'episodeFile' in episode:
|
||||
if episode['episodeFile']['size'] > 20480:
|
||||
|
|
Loading…
Reference in a new issue