File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 6464 "ListItem.PercentPlayed" ,
6565]
6666
67+ build_version = xbmc .getInfoLabel ("System.BuildVersion" )
68+ kodi_version = int (build_version .split ()[0 ][:2 ])
69+
6770if __name__ == '__main__' :
6871 item = sys .listitem # xbmcgui.ListItem()
6972 try :
7578 dbid = xbmc .getInfoLabel ('ListItem.DBID' )
7679 mediatype = xbmc .getInfoLabel ('ListItem.DBTYPE' )
7780 try :
78- tmdbID = item .getUniqueID ('tmdb' )
81+ tmdbID = item .getUniqueID ('tmdb' ) if kodi_version < 20 else item . getVideoInfoTag (). getUniqueID ( 'tmdb' )
7982 except AttributeError :
8083 tmdbID = "not supported"
8184
8285 properties = {
83- 'resume_time' : item .getProperty ('ResumeTime' ),
86+ 'resume_time' : item .getProperty ('ResumeTime' ) if kodi_version < 20 else item .getVideoInfoTag ().getResumeTime (),
87+ 'total_time' : item .getProperty ('TotalTime' ) if kodi_version < 20 else item .getVideoInfoTag ().getResumeTimeTotal (),
8488 'start_offset' : item .getProperty ('StartOffset' ),
8589 'start_percent' : item .getProperty ('StartPercent' ),
86- 'total_time' : item .getProperty ('TotalTime' )
8790 }
8891 log .info ("Properties: %s;" % properties )
8992
Original file line number Diff line number Diff line change 3030ADDON = xbmcaddon .Addon ()
3131api_key = ""
3232
33+ build_version = xbmc .getInfoLabel ("System.BuildVersion" )
34+ kodi_version = int (build_version .split ()[0 ][:2 ])
35+
3336
3437def doAssign ():
3538 mediatype = getMediaType ()
@@ -42,7 +45,7 @@ def doAssign():
4245 use_elementum_path = False
4346
4447 try :
45- tmdbID = sys .listitem .getUniqueID ('tmdb' )
48+ tmdbID = sys .listitem .getUniqueID ('tmdb' ) if kodi_version < 20 else sys . listitem . getVideoInfoTag (). getUniqueID ( 'tmdb' )
4649 except AttributeError :
4750 tmdbID = ""
4851
@@ -175,7 +178,7 @@ def doPlayDownload(action, is_custom=False):
175178def doLibraryAction (action ):
176179 dbid = getDbId ()
177180 try :
178- tmdbID = sys .listitem .getUniqueID ('tmdb' )
181+ tmdbID = sys .listitem .getUniqueID ('tmdb' ) if kodi_version < 20 else sys . listitem . getVideoInfoTag (). getUniqueID ( 'tmdb' )
179182 except AttributeError :
180183 tmdbID = ""
181184 mediatype = getMediaType ()
@@ -208,7 +211,7 @@ def doTraktAction(action):
208211 if not dbid .isdigit ():
209212 showtmdbid = xbmc .getInfoLabel ('ListItem.Property(ShowTMDBId)' )
210213 try :
211- tmdbID = sys .listitem .getUniqueID ('tmdb' )
214+ tmdbID = sys .listitem .getUniqueID ('tmdb' ) if kodi_version < 20 else sys . listitem . getVideoInfoTag (). getUniqueID ( 'tmdb' )
212215 except AttributeError :
213216 tmdbID = ""
214217 if tmdbID == "" or ((mediatype == 'season' or mediatype == 'episode' ) and showtmdbid == "" ):
You can’t perform that action at this time.
0 commit comments