mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Enable keep_history for default user/library
* Log sessions to "Local" if retrieving user/library data fails
This commit is contained in:
parent
5652a2b6c2
commit
c5b2b86786
2 changed files with 12 additions and 9 deletions
|
@ -539,7 +539,7 @@ class Libraries(object):
|
|||
def get_details(self, section_id=None):
|
||||
from plexpy import pmsconnect
|
||||
|
||||
default_return = {'section_id': None,
|
||||
default_return = {'section_id': 0,
|
||||
'section_name': 'Local',
|
||||
'section_type': '',
|
||||
'library_thumb': common.DEFAULT_COVER_THUMB,
|
||||
|
@ -549,7 +549,7 @@ class Libraries(object):
|
|||
'child_count': 0,
|
||||
'do_notify': 0,
|
||||
'do_notify_created': 0,
|
||||
'keep_history': 0
|
||||
'keep_history': 1
|
||||
}
|
||||
|
||||
if not section_id:
|
||||
|
@ -602,7 +602,8 @@ class Libraries(object):
|
|||
return library_details
|
||||
|
||||
else:
|
||||
logger.warn(u"PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.")
|
||||
logger.warn(u"PlexPy Libraries :: Unable to retrieve library %s from database. Requesting library list refresh."
|
||||
% section_id)
|
||||
# Let's first refresh the libraries list to make sure the library isn't newly added and not in the db yet
|
||||
pmsconnect.refresh_libraries()
|
||||
|
||||
|
@ -612,9 +613,9 @@ class Libraries(object):
|
|||
return library_details
|
||||
|
||||
else:
|
||||
logger.warn(u"PlexPy Users :: Unable to retrieve user from local database. Returning 'Local' library.")
|
||||
logger.warn(u"PlexPy Users :: Unable to retrieve library %s from database. Returning 'Local' library."
|
||||
% section_id)
|
||||
# If there is no library data we must return something
|
||||
# Use "Local" library to retain compatibility with PlexWatch database value
|
||||
return default_return
|
||||
|
||||
def get_watch_time_stats(self, section_id=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue