mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-10 16:57:45 +08:00
Update backend API to only send requirement info
This commit is contained in:
parent
6d5c5a88bd
commit
5c2651ba56
1 changed files with 15 additions and 2 deletions
|
@ -557,9 +557,22 @@ class SubtitleNameInfo(Resource):
|
|||
opts = dict()
|
||||
opts['type'] = 'episode'
|
||||
result = guessit(name, options=opts)
|
||||
|
||||
res = dict()
|
||||
if result['episode'] is not None:
|
||||
res['episode'] = result['episode']
|
||||
else:
|
||||
res['episode'] = 0
|
||||
|
||||
if result['season'] is not None:
|
||||
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…
Reference in a new issue