summaryrefslogtreecommitdiff
path: root/plugin.video.embycon
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
parentdc0c5bd3f8473976775155e28885260c8c99d3d1 (diff)
[plugin.video.embycon] 1.3.24 (#1352)
Diffstat (limited to 'plugin.video.embycon')
-rw-r--r--plugin.video.embycon/addon.xml4
-rw-r--r--plugin.video.embycon/resources/lib/datamanager.py1
-rw-r--r--plugin.video.embycon/resources/lib/functions.py42
-rw-r--r--plugin.video.embycon/resources/lib/menu_functions.py1
-rw-r--r--plugin.video.embycon/resources/lib/simple_logging.py2
-rw-r--r--plugin.video.embycon/resources/lib/translation.py1
-rw-r--r--plugin.video.embycon/resources/lib/utils.py2
-rw-r--r--plugin.video.embycon/service.py17
8 files changed, 44 insertions, 26 deletions
diff --git a/plugin.video.embycon/addon.xml b/plugin.video.embycon/addon.xml
index fdcabe5..fc03295 100644
--- a/plugin.video.embycon/addon.xml
+++ b/plugin.video.embycon/addon.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
- version="1.3.20"
+ version="1.3.24"
provider-name="Team B">
<requires>
- <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="xbmc.python" version="2.24.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
diff --git a/plugin.video.embycon/resources/lib/datamanager.py b/plugin.video.embycon/resources/lib/datamanager.py
index a94a38b..f5f69b5 100644
--- a/plugin.video.embycon/resources/lib/datamanager.py
+++ b/plugin.video.embycon/resources/lib/datamanager.py
@@ -4,6 +4,7 @@ import hashlib
import os
import threading
import json
+import encodings
import xbmcaddon
import xbmc
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))
diff --git a/plugin.video.embycon/resources/lib/menu_functions.py b/plugin.video.embycon/resources/lib/menu_functions.py
index 19467b6..6fc0838 100644
--- a/plugin.video.embycon/resources/lib/menu_functions.py
+++ b/plugin.video.embycon/resources/lib/menu_functions.py
@@ -3,6 +3,7 @@
import sys
import json
import urllib
+import encodings
import xbmcplugin
import xbmcaddon
diff --git a/plugin.video.embycon/resources/lib/simple_logging.py b/plugin.video.embycon/resources/lib/simple_logging.py
index f25bcd4..63ce6ac 100644
--- a/plugin.video.embycon/resources/lib/simple_logging.py
+++ b/plugin.video.embycon/resources/lib/simple_logging.py
@@ -1,5 +1,7 @@
# Gnu General Public License - see LICENSE.TXT
+import encodings
+
import xbmc
import xbmcaddon
from json_rpc import json_rpc
diff --git a/plugin.video.embycon/resources/lib/translation.py b/plugin.video.embycon/resources/lib/translation.py
index 4db8939..f0c2214 100644
--- a/plugin.video.embycon/resources/lib/translation.py
+++ b/plugin.video.embycon/resources/lib/translation.py
@@ -1,3 +1,4 @@
+import encodings
import xbmcaddon
from simple_logging import SimpleLogging
diff --git a/plugin.video.embycon/resources/lib/utils.py b/plugin.video.embycon/resources/lib/utils.py
index 6afa3bd..05a1094 100644
--- a/plugin.video.embycon/resources/lib/utils.py
+++ b/plugin.video.embycon/resources/lib/utils.py
@@ -1,7 +1,7 @@
# Gnu General Public License - see LICENSE.TXT
import xbmcaddon
-
import re
+import encodings
from downloadutils import DownloadUtils
from simple_logging import SimpleLogging
diff --git a/plugin.video.embycon/service.py b/plugin.video.embycon/service.py
index 83a1da2..2a71d93 100644
--- a/plugin.video.embycon/service.py
+++ b/plugin.video.embycon/service.py
@@ -289,11 +289,13 @@ class Service(xbmc.Player):
monitor = Service()
last_progress_update = time.time()
download_utils.checkVersion()
+home_window = HomeWindow()
-xbmc_monitor = xbmc.Monitor()
-while not xbmc_monitor.abortRequested():
+# monitor.abortRequested() is causes issues, it currently triggers for all addon cancelations which causes
+# the service to exit when a user cancels an addon load action. This is a bug in Kodi.
+# I am switching back to xbmc.abortRequested approach until kodi is fixed or I find a work arround
- home_window = HomeWindow()
+while not xbmc.abortRequested:
if xbmc.Player().isPlaying():
@@ -312,14 +314,13 @@ while not xbmc_monitor.abortRequested():
play_info = json.loads(play_data)
playFile(play_info)
- xbmc_monitor.waitForAbort(1)
- HomeWindow().setProperty("Service_Timestamp", str(int(time.time())))
-
+ home_window.setProperty("Service_Timestamp", str(int(time.time())))
+ xbmc.sleep(1000)
# clear user and token when loggin off
-home_window = HomeWindow()
+home_window.clearProperty("Service_Timestamp")
home_window.clearProperty("userid")
home_window.clearProperty("AccessToken")
home_window.clearProperty("Params")
-log.debug("Service shutting down")
+log.error("Service shutting down")