mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 16:22:57 -07:00
Fix downloading export file
This commit is contained in:
parent
91d545f480
commit
d5e91801d6
1 changed files with 3 additions and 3 deletions
|
@ -6507,7 +6507,6 @@ class WebInterface(object):
|
|||
'message': 'Metadata export has started. Check the logs to monitor any problems.'}
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def download_export(self, row_id=None, **kwargs):
|
||||
|
@ -6526,7 +6525,7 @@ class WebInterface(object):
|
|||
"""
|
||||
result = exporter.get_export(export_id=row_id)
|
||||
if result and result['complete'] and result['exists']:
|
||||
serve_download(path=exporter.get_export_filepath(result['filename']), name=result['filename'])
|
||||
return serve_download(exporter.get_export_filepath(result['filename']), name=result['filename'])
|
||||
else:
|
||||
if result and not result.get('complete'):
|
||||
msg = 'Export is still being processed.'
|
||||
|
@ -6534,7 +6533,8 @@ class WebInterface(object):
|
|||
msg = 'Export file does not exist.'
|
||||
else:
|
||||
msg = 'Invalid row_id provided.'
|
||||
return {'result': 'error', 'message': msg}
|
||||
cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
||||
return json.dumps({'result': 'error', 'message': msg}).encode('utf-8')
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue