From 2d6b371155513167b360c9fd2a0b08130a2e9d76 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Jun 2017 15:16:37 +0200 Subject: [PATCH 1/4] Fix Client.Product None --- Contents/Services/URL/drdk live/ServiceCode.pys | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Contents/Services/URL/drdk live/ServiceCode.pys b/Contents/Services/URL/drdk live/ServiceCode.pys index 35863ef..527f0d0 100644 --- a/Contents/Services/URL/drdk live/ServiceCode.pys +++ b/Contents/Services/URL/drdk live/ServiceCode.pys @@ -48,8 +48,14 @@ def PlayMedia(slug): def gemius(id): # construct JSON for DR most viewed HTTP POST - json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + Client.Product + '.' + Client.Version + '"}') - # POST to increase DR most viewed list + + # Sometimes Product is None: + product = Client.Product + if product is None: + product = 'unknown' + + json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + product + '.' + Client.Version + '"}') + # POST to increase DR most viewed list HTTP.Request(API_URL + API_VERSION + '/reporting/viewed', values = json, method = 'POST') return None From 0d961f51df515cc49e20338147476e9f2ea4c3f0 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Jun 2017 15:18:58 +0200 Subject: [PATCH 2/4] Spaces -> tabs --- Contents/Services/URL/drdk live/ServiceCode.pys | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Contents/Services/URL/drdk live/ServiceCode.pys b/Contents/Services/URL/drdk live/ServiceCode.pys index 527f0d0..4d0f05f 100644 --- a/Contents/Services/URL/drdk live/ServiceCode.pys +++ b/Contents/Services/URL/drdk live/ServiceCode.pys @@ -50,9 +50,9 @@ def gemius(id): # construct JSON for DR most viewed HTTP POST # Sometimes Product is None: - product = Client.Product - if product is None: - product = 'unknown' + product = Client.Product + if product is None: + product = 'unknown' json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + product + '.' + Client.Version + '"}') # POST to increase DR most viewed list From 4a749485e330f58cd3e798961b49cd0439edd95f Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Jun 2017 15:16:37 +0200 Subject: [PATCH 3/4] Fix Client.Product None --- Contents/Services/URL/drdk live/ServiceCode.pys | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Contents/Services/URL/drdk live/ServiceCode.pys b/Contents/Services/URL/drdk live/ServiceCode.pys index 35863ef..4d0f05f 100644 --- a/Contents/Services/URL/drdk live/ServiceCode.pys +++ b/Contents/Services/URL/drdk live/ServiceCode.pys @@ -48,8 +48,14 @@ def PlayMedia(slug): def gemius(id): # construct JSON for DR most viewed HTTP POST - json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + Client.Product + '.' + Client.Version + '"}') - # POST to increase DR most viewed list + + # Sometimes Product is None: + product = Client.Product + if product is None: + product = 'unknown' + + json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + product + '.' + Client.Version + '"}') + # POST to increase DR most viewed list HTTP.Request(API_URL + API_VERSION + '/reporting/viewed', values = json, method = 'POST') return None From 58d8230f693f15f4475e0b49ba8f96b39a13c8dc Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Jun 2017 15:16:37 +0200 Subject: [PATCH 4/4] Fix Client.Product None --- Contents/Services/URL/drdk live/ServiceCode.pys | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Contents/Services/URL/drdk live/ServiceCode.pys b/Contents/Services/URL/drdk live/ServiceCode.pys index 35863ef..4d0f05f 100644 --- a/Contents/Services/URL/drdk live/ServiceCode.pys +++ b/Contents/Services/URL/drdk live/ServiceCode.pys @@ -48,8 +48,14 @@ def PlayMedia(slug): def gemius(id): # construct JSON for DR most viewed HTTP POST - json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + Client.Product + '.' + Client.Version + '"}') - # POST to increase DR most viewed list + + # Sometimes Product is None: + product = Client.Product + if product is None: + product = 'unknown' + + json = JSON.ObjectFromString('{"id":"' + id + '","Client":"Plex.' + product + '.' + Client.Version + '"}') + # POST to increase DR most viewed list HTTP.Request(API_URL + API_VERSION + '/reporting/viewed', values = json, method = 'POST') return None