summaryrefslogtreecommitdiff
path: root/plugin.video.embycon/resources/lib/functions.py
diff options
context:
space:
mode:
authorShaun <shaun@bluebit.com.au>2017-08-01 23:48:21 +1000
committerenen92 <enen92@users.noreply.github.com>2017-08-01 14:48:21 +0100
commit9cbbf6b25471a9ef6725f0aeeb15d82e48e89852 (patch)
treec0b978c83e582b5591b28519f66c270fa84c3fc7 /plugin.video.embycon/resources/lib/functions.py
parentdc0c5bd3f8473976775155e28885260c8c99d3d1 (diff)
[plugin.video.embycon] 1.3.24 (#1352)
Diffstat (limited to 'plugin.video.embycon/resources/lib/functions.py')
-rw-r--r--plugin.video.embycon/resources/lib/functions.py42
1 files changed, 27 insertions, 15 deletions
diff --git a/plugin.video.embycon/resources/lib/functions.py b/plugin.video.embycon/resources/lib/functions.py
index ac55087..34f0322 100644
--- a/plugin.video.embycon/resources/lib/functions.py
+++ b/plugin.video.embycon/resources/lib/functions.py
@@ -8,6 +8,7 @@ import cProfile
import pstats
import json
import StringIO
+import encodings
import xbmcplugin
import xbmcgui
@@ -654,16 +655,19 @@ def processDirectory(results, progress, params):
if prefix != '':
tempTitle = prefix + ' - ' + tempTitle
- if (item.get("PremiereDate") != None):
- premieredatelist = (item.get("PremiereDate")).split("T")
- premieredate = premieredatelist[0]
- else:
- premieredate = ""
+ production_year = item.get("ProductionYear")
+ if not production_year and item.get("PremiereDate"):
+ production_year = int(item.get("PremiereDate")[:4])
+
+ premiere_date = ""
+ if item.get("PremiereDate") != None:
+ tokens = (item.get("PremiereDate")).split("T")
+ premiere_date = tokens[0]
- # add the premiered date for Upcoming TV
+ # add the premiered date for Upcoming TV
if item.get("LocationType") == "Virtual":
airtime = item.get("AirTime")
- tempTitle = tempTitle + ' - ' + str(premieredate) + ' - ' + str(airtime)
+ tempTitle = tempTitle + ' - ' + str(premiere_date) + ' - ' + str(airtime)
# Process MediaStreams
channels = ''
@@ -809,9 +813,9 @@ def processDirectory(results, progress, params):
'mpaa': item.get("OfficialRating"),
'rating': item.get("CommunityRating"),
'criticrating': item.get("CriticRating"),
- 'year': item.get("ProductionYear"),
+ 'year': production_year,
+ 'premieredate': premiere_date,
'locationtype': item.get("LocationType"),
- 'premieredate': premieredate,
'studio': studio,
'genre': genre,
'playcount': str(playCount),
@@ -844,12 +848,20 @@ def processDirectory(results, progress, params):
extraData['mode'] = "GET_CONTENT"
if isFolder == True:
- u = ('{server}/emby/Users/{userid}/items' +
- '?ParentId=' + id +
- '&IsVirtualUnAired=false' +
- '&IsMissing=false&' +
- 'Fields=' + detailsString +
- '&format=json')
+
+ if item.get("Type", "") == "Series":
+ u = ('{server}/emby/Shows/' + id +
+ '/Seasons'
+ '?userId={userid}' +
+ '&Fields=' + detailsString +
+ '&format=json')
+ else:
+ u = ('{server}/emby/Users/{userid}/items' +
+ '?ParentId=' + id +
+ '&IsVirtualUnAired=false' +
+ '&IsMissing=false&' +
+ 'Fields=' + detailsString +
+ '&format=json')
if item.get("RecursiveItemCount") != 0:
dirItems.append(addGUIItem(u, details, extraData, display_options))