mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Return empty list for datatable errors
This commit is contained in:
parent
5ca8184948
commit
674966510d
4 changed files with 15 additions and 22 deletions
|
@ -210,8 +210,9 @@ class DataFactory(object):
|
|||
return {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': [],
|
||||
'filter_duration': '0',
|
||||
'total_duration': '0'}
|
||||
|
||||
history = query['result']
|
||||
|
||||
|
@ -1719,8 +1720,7 @@ class DataFactory(object):
|
|||
return {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
notifications = query['result']
|
||||
|
||||
|
@ -1798,8 +1798,7 @@ class DataFactory(object):
|
|||
return {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
newsletters = query['result']
|
||||
|
||||
|
|
|
@ -2191,8 +2191,7 @@ def get_export_datatable(section_id=None, user_id=None, rating_key=None, kwargs=
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
data_tables = datatables.DataTables()
|
||||
|
||||
|
|
|
@ -197,8 +197,7 @@ def get_collections_list(section_id=None, **kwargs):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to get collections: missing section_id.'}
|
||||
'data': []}
|
||||
return default_return
|
||||
|
||||
collections = get_collections(section_id=section_id)
|
||||
|
@ -282,8 +281,7 @@ def get_playlists_list(section_id=None, user_id=None, **kwargs):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to get playlists: missing section_id.'}
|
||||
'data': []}
|
||||
return default_return
|
||||
|
||||
playlists = get_playlists(section_id=section_id, user_id=user_id)
|
||||
|
@ -313,8 +311,7 @@ class Libraries(object):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
data_tables = datatables.DataTables()
|
||||
|
||||
|
@ -456,8 +453,9 @@ class Libraries(object):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': [],
|
||||
'filtered_file_size': 0,
|
||||
'total_file_size': 0}
|
||||
|
||||
if not session.allow_session_library(section_id):
|
||||
return default_return
|
||||
|
|
|
@ -103,8 +103,7 @@ class Users(object):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
data_tables = datatables.DataTables()
|
||||
|
||||
|
@ -241,8 +240,7 @@ class Users(object):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
if not session.allow_session_user(user_id):
|
||||
return default_return
|
||||
|
@ -871,8 +869,7 @@ class Users(object):
|
|||
default_return = {'recordsFiltered': 0,
|
||||
'recordsTotal': 0,
|
||||
'draw': 0,
|
||||
'data': 'null',
|
||||
'error': 'Unable to execute database query.'}
|
||||
'data': []}
|
||||
|
||||
if not session.allow_session_user(user_id):
|
||||
return default_return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue