Merge pull request #1192 from LASER-Yi/fix-upload

Update backend API to only send requirement info
pull/1211/head
morpheus65535 4 years ago committed by GitHub
commit 772efee565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -557,9 +557,22 @@ class SubtitleNameInfo(Resource):
opts = dict()
opts['type'] = 'episode'
result = guessit(name, options=opts)
res = dict()
if 'episode' in result:
res['episode'] = result['episode']
else:
res['episode'] = 0
if 'season' in result:
res['season'] = result['season']
else:
res['season'] = 0
if 'subtitle_language' in result:
result['subtitle_language'] = str(result['subtitle_language'])
return jsonify(data=result)
res['subtitle_language'] = str(result['subtitle_language'])
return jsonify(data=res)
else:
return '', 400

Loading…
Cancel
Save