From 51f1acef96971c3fffc879c0bd10ed492cb611a3 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 18 Oct 2018 07:07:51 -0500 Subject: [PATCH] Add logging and small fixes Prepare userdata by date modified --- resources/lib/downloader.py | 2 +- resources/lib/emby/core/api.py | 12 +++++++++++- resources/lib/monitor.py | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lib/downloader.py b/resources/lib/downloader.py index 18064cfd..749412c4 100644 --- a/resources/lib/downloader.py +++ b/resources/lib/downloader.py @@ -345,7 +345,7 @@ class TheVoid(object): if window('emby_should_stop.bool'): LOG.info("Abandon mission! A black hole just swallowed [ %s/%s ]", self.method, self.data['VoidName']) - return default + return xbmc.sleep(100) LOG.info("--[ void/%s ]", self.data['VoidName']) diff --git a/resources/lib/emby/core/api.py b/resources/lib/emby/core/api.py index 63009225..df90020d 100644 --- a/resources/lib/emby/core/api.py +++ b/resources/lib/emby/core/api.py @@ -252,11 +252,21 @@ def get_date_modified(date, parent_id, media=None): 'IsMissing': False, 'IsVirtualUnaired': False, 'IncludeItemTypes': media or None, - #'MinDateLastSavedForUser': date, 'MinDateLastSaved': date, 'Fields': info() }) +def get_userdata_date_modified(date, parent_id, media=None): + return users("/Items", params={ + 'ParentId': parent_id, + 'Recursive': True, + 'IsMissing': False, + 'IsVirtualUnaired': False, + 'IncludeItemTypes': media or None, + 'MinDateLastSavedForUser': date, + 'Fields': info() + }) + def refresh_item(item_id): return items("/%s/Refresh" % item_id, "POST", json={ 'Recursive': True, diff --git a/resources/lib/monitor.py b/resources/lib/monitor.py index 1ebe3873..5c56a0a2 100644 --- a/resources/lib/monitor.py +++ b/resources/lib/monitor.py @@ -282,6 +282,7 @@ class Monitor(xbmc.Monitor): self.additional_users(server) def post_capabilities(self, server): + LOG.info("--[ post capabilities/%s ]", server['auth/server-id']) server['api'].post_capabilities({ 'PlayableMediaTypes': "Audio,Video",