Kodi Community Forum

Full Version: how to set season and episode on kodi 20?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
would it be this?
Code:

xbmc.InfoTagVideo().setSeason(int(season))
xbmc.InfoTagVideo().setEpisode(int(episode))
I am not sure
It would be helpful if you gave more explanation on what you are trying to do. Where are you using this?
(2021-10-25, 03:33)Karellen Wrote: [ -> ]It would be helpful if you gave more explanation on what you are trying to do. Where are you using this?
I want to defines a season and an episode in the add-on video on kodi 20 to be used with the add-on subtitle, and also defines other information in the video.

https://codedocs.xyz/xbmc/xbmc/python_v2..._v20000192
in the Kodi 20 documents, it seems that setinfo in listitem will be discontinued, I was wondering what the new directory with the information would be like

to reproduce use this:
python:

def play(name,url,iconimage,fanart,description,genre,imdbnumber,originaltitle,year,season,episode,playable,subtitle):
    if not season == 'false' and not episode == 'false':
        if int(season) < 10:
            sdesc = '0%s'%str(season)
        else:
            sdesc = str(season)
        if int(episode) < 10:
            edesc = '0%s'%str(episode)
        else:
            edesc = str(episode)
        name = '%s - S%sE%s'%(name,sdesc,edesc)
    if url:    
        if six.PY3:
            li=xbmcgui.ListItem(name, path=url)
            if iconimage:
                #li.setArt({"icon": "DefaultVideo.png", "thumb": iconimage})
                li.setArt({"icon": "DefaultVideo.png", "thumb": iconimage})
        else:
            li = xbmcgui.ListItem(name, path=url, iconImage=iconimage, thumbnailImage=iconimage)
        li.setInfo(type="Video", infoLabels={"Title": name, "Plot": description})
        if not genre == 'false':
            try:
                li.setInfo('video', { 'genre': str(genre) })
            except:
                pass 
        if not imdbnumber == 'false':
            try:
                li.setInfo('video', { 'imdbnumber': str(imdbnumber) })
            except:
                pass
        if not originaltitle == 'false':
            try:
                li.setInfo('video', { 'originaltitle': str(originaltitle) })
            except:
                pass
        if not year == '0' and not year == 0:
            try:
                li.setInfo('video', { 'year': int(year) })
            except:
                pass                
        if not season == 'false':
            try:
                li.setInfo('video', { 'season': int(season) })
            except:
                pass
        if not episode == 'false':
            try:
                li.setInfo('video', { 'episode': int(episode) })
            except:
                pass               
        if not subtitle == 'false':
            li.setSubtitles([subtitle])
        if not playable == 'false':
            xbmcplugin.setResolvedUrl(handle, True, li)
        else:
            xbmc.Player().play(item=url, listitem=li)

I would like to port completely to the kodi 20