From 50ce29cc6423e1dd7b9ad414e4ed6226a78ba427 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 29 Mar 2020 21:14:17 -0700 Subject: [PATCH 1/6] Fix enable notification grouping by default again --- data/interfaces/default/welcome.html | 2 ++ plexpy/config.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/welcome.html b/data/interfaces/default/welcome.html index 0c1c101a..86b80ec1 100644 --- a/data/interfaces/default/welcome.html +++ b/data/interfaces/default/welcome.html @@ -224,6 +224,8 @@ + + diff --git a/plexpy/config.py b/plexpy/config.py index c8675d21..796cc1f2 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -338,7 +338,7 @@ _CONFIG_DEFINITIONS = { 'NMA_ON_NEWDEVICE': (int, 'NMA', 0), 'NOTIFICATION_THREADS': (int, 'Advanced', 2), 'NOTIFY_CONSECUTIVE': (int, 'Monitoring', 1), - 'NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT': (int, 'Monitoring', 0), + 'NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT': (int, 'Monitoring', 1), 'NOTIFY_GROUP_RECENTLY_ADDED_PARENT': (int, 'Monitoring', 1), 'NOTIFY_GROUP_RECENTLY_ADDED': (int, 'Monitoring', 1), 'NOTIFY_UPLOAD_POSTERS': (int, 'Monitoring', 0), From 1ffd6c0ea13dd68065b4a0640a4eb3075574df35 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Mon, 30 Mar 2020 13:55:17 -0700 Subject: [PATCH 2/6] Encode API XML output to UTF-8 --- plexpy/api2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/api2.py b/plexpy/api2.py index c7b612c1..7a50f803 100644 --- a/plexpy/api2.py +++ b/plexpy/api2.py @@ -619,9 +619,9 @@ General optional parameters: cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8' try: if self._api_debug: - out = json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False).encode('utf-8') + out = json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False) else: - out = json.dumps(out, ensure_ascii=False).encode('utf-8') + out = json.dumps(out, ensure_ascii=False) if self._api_callback is not None: cherrypy.response.headers['Content-Type'] = 'application/javascript' # wrap with JSONP call if requested @@ -634,7 +634,7 @@ General optional parameters: out['result'] = 'error' elif self._api_out_type == 'xml': - cherrypy.response.headers['Content-Type'] = 'application/xml' + cherrypy.response.headers['Content-Type'] = 'application/xml;charset=UTF-8' try: out = xmltodict.unparse(out, pretty=True) except Exception as e: @@ -655,7 +655,7 @@ General optional parameters: ''' % e - return out + return out.encode('utf-8') def _api_run(self, *args, **kwargs): """ handles the stuff from the handler """ From 009971901be59604fa312b059a8db582df770afb Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 3 Apr 2020 20:53:35 -0700 Subject: [PATCH 3/6] Fix delete lookup info by rating key --- plexpy/datafactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index f7799805..1bbba1b3 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -1415,7 +1415,7 @@ class DataFactory(object): if rating_key: logger.info(u"Tautulli DataFactory :: Deleting lookup info for rating_key %s from the database." - % (title, rating_key)) + % rating_key) result_themoviedb = monitor_db.action('DELETE FROM themoviedb_lookup WHERE rating_key = ?', [rating_key]) result_tvmaze = monitor_db.action('DELETE FROM tvmaze_lookup WHERE rating_key = ?', [rating_key]) result_musicbrainz = monitor_db.action('DELETE FROM musicbrainz_lookup WHERE rating_key = ?', [rating_key]) From aac705f465b556bac5cf4ff5b30f6ac37c264837 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 3 Apr 2020 21:05:44 -0700 Subject: [PATCH 4/6] Put import OpenSSL in try/except block for self-signed certificates --- plexpy/helpers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 1ed8415e..0777fb85 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -440,7 +440,11 @@ def create_https_certificates(ssl_cert, ssl_key): This code is stolen from SickBeard (http://github.com/midgetspy/Sick-Beard). """ - from OpenSSL import crypto + try: + from OpenSSL import crypto + except ImportError: + logger.error("Unable to generate self-signed certificates: Missing OpenSSL module.") + return False from certgen import createKeyPair, createSelfSignedCertificate, TYPE_RSA serial = int(time.time()) From e8d05578520106d8eef3a9c22adad38973fc74c1 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 3 Apr 2020 21:06:10 -0700 Subject: [PATCH 5/6] Fix typo in send newsletter argument --- plexpy/newsletters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/newsletters.py b/plexpy/newsletters.py index 69d62a2f..2bc83ded 100644 --- a/plexpy/newsletters.py +++ b/plexpy/newsletters.py @@ -284,7 +284,7 @@ def send_newsletter(newsletter_id=None, subject=None, body=None, message=None, n email_config=newsletter_config['email_config'], subject=subject, body=body, - messsage=message) + message=message) return agent.send() else: logger.debug(u"Tautulli Newsletters :: Notification requested but no newsletter_id received.") From 6e09e509bdef05c86829d1b31591f9572cb5d767 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 3 Apr 2020 21:07:00 -0700 Subject: [PATCH 6/6] Remove duplicate dictionary key in top movie stats --- plexpy/datafactory.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 1bbba1b3..58ae5514 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -336,7 +336,6 @@ class DataFactory(object): 'user': '', 'friendly_name': '', 'platform': '', - 'platform': '', 'live': item['live'], 'guid': item['guid'], 'row_id': item['id']