summaryrefslogtreecommitdiff
path: root/plugin.video.embycon/resources/lib/play_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugin.video.embycon/resources/lib/play_utils.py')
-rw-r--r--plugin.video.embycon/resources/lib/play_utils.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/plugin.video.embycon/resources/lib/play_utils.py b/plugin.video.embycon/resources/lib/play_utils.py
index f7cba7c..8e579f1 100644
--- a/plugin.video.embycon/resources/lib/play_utils.py
+++ b/plugin.video.embycon/resources/lib/play_utils.py
@@ -30,7 +30,6 @@ def playFile(play_info):
settings = xbmcaddon.Addon('plugin.video.embycon')
addon_path = settings.getAddonInfo('path')
- playback_type = settings.getSetting("playback_type")
jump_back_amount = int(settings.getSetting("jump_back_amount"))
server = downloadUtils.getServer()
@@ -89,12 +88,12 @@ def playFile(play_info):
playurl, listitem_props = PlayUtils().getStrmDetails(result)
if not playurl:
- playurl = PlayUtils().getPlayUrl(id, result, force_transcode)
+ playurl, playback_type = PlayUtils().getPlayUrl(id, result, force_transcode)
log.debug("Play URL: " + playurl + " ListItem Properties: " + str(listitem_props))
playback_type_string = "DirectPlay"
- if playback_type == "2" or force_transcode:
+ if playback_type == "2":
playback_type_string = "Transcode"
elif playback_type == "1":
playback_type_string = "DirectStream"
@@ -108,9 +107,22 @@ def playFile(play_info):
else:
result["Overview"] = playback_type_string
- list_item = xbmcgui.ListItem(label=result.get("Name", i18n('missing_title')), path=playurl)
+ item_title = result.get("Name", i18n('missing_title'))
+ add_episode_number = settings.getSetting('addEpisodeNumber') == 'true'
+ if result.get("Type") == "Episode" and add_episode_number:
+ episode_num = result.get("IndexNumber")
+ if episode_num is not None:
+ if episode_num < 10:
+ episode_num = "0" + str(episode_num)
+ else:
+ episode_num = str(episode_num)
+ else:
+ episode_num = ""
+ item_title = episode_num + " - " + item_title
+
+ list_item = xbmcgui.ListItem(label=item_title, path=playurl)
- list_item = setListItemProps(id, list_item, result, server, listitem_props)
+ list_item = setListItemProps(id, list_item, result, server, listitem_props, item_title)
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
@@ -138,7 +150,7 @@ def playFile(play_info):
xbmc.sleep(100)
# xbmc.Player().play()
-def setListItemProps(id, listItem, result, server, extra_props):
+def setListItemProps(id, listItem, result, server, extra_props, title):
# set up item and item info
thumbID = id
eppNum = -1
@@ -152,13 +164,14 @@ def setListItemProps(id, listItem, result, server, extra_props):
listItem.setProperty('IsPlayable', 'true')
listItem.setProperty('IsFolder', 'false')
+ listItem.setProperty('id', result.get("Id"))
for prop in extra_props:
listItem.setProperty(prop[0], prop[1])
# play info
details = {
- 'title': result.get("Name", i18n('missing_title')),
+ 'title': title,
'plot': result.get("Overview")
}