Skip to content

Commit c262906

Browse files
authored
0.3.8
1 parent 972d457 commit c262906

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

service.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ def run_service(self):
5656
if (self.selecteditem and self.selecteditem != self.previousitem):
5757
self.previousitem = self.selecteditem
5858

59-
if (xbmc.getInfoLabel("ListItem.DBID") > -1 and not xbmc.getCondVisibility("ListItem.IsFolder")) and xbmc.getInfoLabel("ListItem.Duration") and int(float(xbmc.getInfoLabel("ListItem.Duration"))) > 0:
60-
self.duration = xbmc.getInfoLabel("ListItem.Duration")
61-
self.dbid = xbmc.getInfoLabel("ListItem.DBID")
62-
self.set_duration_values()
59+
if (xbmc.getInfoLabel("ListItem.DBID") and xbmc.getInfoLabel("ListItem.DBTYPE") and (xbmc.getInfoLabel("ListItem.DBTYPE") == 'movie' or xbmc.getInfoLabel("ListItem.DBTYPE") == 'episode') and not xbmc.getCondVisibility("ListItem.IsFolder")) and xbmc.getInfoLabel("ListItem.Duration"):
60+
try:
61+
tmpval = float(int(xbmc.getInfoLabel("ListItem.Duration")))
62+
if (tmpval > 0) :
63+
self.duration = xbmc.getInfoLabel("ListItem.Duration")
64+
self.dbid = xbmc.getInfoLabel("ListItem.DBID")
65+
self.set_duration_values()
66+
except:
67+
pass
6368
else:
6469
my_container_id = xbmc.getInfoLabel("Window(Home).Property(Durations.WidgetContainerId)")
6570
my_container_window = xbmc.getInfoLabel("Window(Home).Property(Durations.WidgetContainerWindowName)")
@@ -68,10 +73,15 @@ def run_service(self):
6873
self.selecteditem = xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBID")
6974
if (self.selecteditem and self.selecteditem != self.previousitem):
7075
self.previousitem = self.selecteditem
71-
if (xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBID") > -1 and not xbmc.getCondVisibility("Container("+my_container_id+").ListItem.IsFolder")) and xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration") and int(float(xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration"))) > 0:
72-
self.duration = xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration")
73-
self.dbid = xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBID")
74-
self.set_duration_values()
76+
if (xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBID") and xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBTYPE") and (xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBTYPE") == 'movie' or xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBTYPE") == 'episode') and not xbmc.getCondVisibility("Container("+my_container_id+").ListItem.IsFolder")) and xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration"):
77+
try:
78+
tmpval = float(int(xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration")))
79+
if (tmpval > 0) :
80+
self.duration = xbmc.getInfoLabel("Container("+my_container_id+").ListItem.Duration")
81+
self.dbid = xbmc.getInfoLabel("Container("+my_container_id+").ListItem.DBID")
82+
self.set_duration_values()
83+
except:
84+
pass
7585
#run_service end
7686

7787
def set_duration_values(self):

0 commit comments

Comments
 (0)