|
|
@ -2014,10 +2014,16 @@ class SubtitleNameInfo(Resource):
|
|
|
|
if 'subtitle_language' in guessit_result:
|
|
|
|
if 'subtitle_language' in guessit_result:
|
|
|
|
result['subtitle_language'] = str(guessit_result['subtitle_language'])
|
|
|
|
result['subtitle_language'] = str(guessit_result['subtitle_language'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result['episode'] = 0
|
|
|
|
if 'episode' in guessit_result:
|
|
|
|
if 'episode' in guessit_result:
|
|
|
|
result['episode'] = int(guessit_result['episode'])
|
|
|
|
if isinstance(guessit_result['episode'], list):
|
|
|
|
else:
|
|
|
|
# for multiple episodes file, choose the first episode number
|
|
|
|
result['episode'] = 0
|
|
|
|
if len(guessit_result['episode']):
|
|
|
|
|
|
|
|
# make sure that guessit returned a list of more than 0 items
|
|
|
|
|
|
|
|
result['episode'] = int(guessit_result['episode'][0])
|
|
|
|
|
|
|
|
elif isinstance(guessit_result['episode'], (str, int)):
|
|
|
|
|
|
|
|
# if single episode (should be int but just in case we cast it to int)
|
|
|
|
|
|
|
|
result['episode'] = int(guessit_result['episode'])
|
|
|
|
|
|
|
|
|
|
|
|
if 'season' in guessit_result:
|
|
|
|
if 'season' in guessit_result:
|
|
|
|
result['season'] = int(guessit_result['season'])
|
|
|
|
result['season'] = int(guessit_result['season'])
|
|
|
|