Fix error code 500 in /api/subtitles/info API #1551

pull/1556/head
LASER-Yi 3 years ago
parent 07ff287896
commit 6b06362179
No known key found for this signature in database
GPG Key ID: F5CDE034FD72708F

@ -2008,18 +2008,19 @@ class SubtitleNameInfo(Resource):
for name in names: for name in names:
opts = dict() opts = dict()
opts['type'] = 'episode' opts['type'] = 'episode'
result = guessit(name, options=opts) guessit_result = guessit(name, options=opts)
result = {}
result['filename'] = name result['filename'] = name
if 'subtitle_language' in result: if 'subtitle_language' in guessit_result:
result['subtitle_language'] = str(result['subtitle_language']) result['subtitle_language'] = str(guessit_result['subtitle_language'])
if 'episode' in result: if 'episode' in guessit_result:
result['episode'] = result['episode'] result['episode'] = int(guessit_result['episode'])
else: else:
result['episode'] = 0 result['episode'] = 0
if 'season' in result: if 'season' in guessit_result:
result['season'] = result['season'] result['season'] = int(guessit_result['season'])
else: else:
result['season'] = 0 result['season'] = 0

Loading…
Cancel
Save