diff --git a/plexpy/libraries.py b/plexpy/libraries.py index 3f01d614..455ca7a5 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -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): diff --git a/plexpy/users.py b/plexpy/users.py index 44b68090..9207ad0d 100644 --- a/plexpy/users.py +++ b/plexpy/users.py @@ -241,7 +241,7 @@ class Users(object): def get_details(self, user_id=None, user=None): from plexpy import plextv - default_return = {'user_id': None, + default_return = {'user_id': 0, 'username': 'Local', 'friendly_name': 'Local', 'user_thumb': common.DEFAULT_USER_THUMB, @@ -250,7 +250,7 @@ class Users(object): 'is_allow_sync': 0, 'is_restricted': 0, 'do_notify': 0, - 'keep_history': 0 + 'keep_history': 1 } if not user_id and not user: @@ -312,7 +312,8 @@ class Users(object): return user_details else: - logger.warn(u"PlexPy Users :: Unable to retrieve user from local database. Requesting user list refresh.") + logger.warn(u"PlexPy Users :: Unable to retrieve user %s from database. Requesting user list refresh." + % user_id if user_id else user) # Let's first refresh the user list to make sure the user isn't newly added and not in the db yet plextv.refresh_users() @@ -322,7 +323,8 @@ class Users(object): return user_details else: - logger.warn(u"PlexPy Users :: Unable to retrieve user from local database. Returning 'Local' user.") + logger.warn(u"PlexPy Users :: Unable to retrieve user %s from database. Returning 'Local' user." + % user_id if user_id else user) # If there is no user data we must return something # Use "Local" user to retain compatibility with PlexWatch database value return default_return