From e90919e6b6070e5ba50914daa2055824a046c419 Mon Sep 17 00:00:00 2001 From: shaun Date: Sun, 5 Feb 2017 11:00:20 +1100 Subject: [PATCH] less metric logging for download function --- addon.xml | 2 +- resources/lib/downloadutils.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addon.xml b/addon.xml index e84041d4..0f3c58fa 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index ad3d52cd..fb11563d 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -216,10 +216,10 @@ class DownloadUtils(object): self._ensure_server(server_id) server = self.session if server_id is None else self.servers[server_id] - if server is None or server.get("Server", None) is None or server.get("UserId", None) is None: + if not server or not server.get("Server") or not server.get("UserId"): log.info("Aborting download, Server Details Error: %s url=%s" % (server, url)) exc = Exception("Aborting download, Server Details Error: %s url=%s" % (server, url)) - #exc.quiet = True + exc.quiet = True raise exc if server_id is None and self.session_requests is not None: # Main server @@ -238,7 +238,7 @@ class DownloadUtils(object): # does the URL look ok if url.startswith('/'): exc = Exception("URL Error: " + url) - #exc.quiet = True + exc.quiet = True raise exc ##### PREPARE REQUEST ##### @@ -326,9 +326,8 @@ class DownloadUtils(object): message="Unauthorized.", icon=xbmcgui.NOTIFICATION_ERROR) - exc = Exception("HTTPError : " + str(response.status_code) + " : " + str(error)) - #exc.quiet = True - raise exc + error.quiet = True + raise # if we got to here and did not process the download for some reason then that is bad exc = Exception("Unhandled Download : %s", url)