forked from 0x2620/pandora
only request subtitles if a subtitles layer is defined, fixed #427
This commit is contained in:
parent
b9129b10c7
commit
2cf7c56115
1 changed files with 7 additions and 3 deletions
|
@ -104,10 +104,14 @@ def update(request):
|
||||||
response['data']['data'] += [f.file.oshash for f in files.filter(file__is_audio=True,
|
response['data']['data'] += [f.file.oshash for f in files.filter(file__is_audio=True,
|
||||||
file__available=False,
|
file__available=False,
|
||||||
file__wanted=True)]
|
file__wanted=True)]
|
||||||
response['data']['file'] = [f.file.oshash for f in files.filter(file__is_subtitle=True,
|
|
||||||
|
if filter(lambda l: l['id'] == 'subtitles', settings.CONFIG['layers']):
|
||||||
|
response['data']['file'] = [f.file.oshash
|
||||||
|
for f in files.filter(file__is_subtitle=True,
|
||||||
file__available=False,
|
file__available=False,
|
||||||
path__endswith='.srt')]
|
path__endswith='.srt')]
|
||||||
|
else:
|
||||||
|
response['data']['file'] = []
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(update, cache=False)
|
actions.register(update, cache=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue