How to use Label2 for TV Shows?
#1
I'm set label2mask property for the sorth method with xbmcplugin.addSortMethod.
For movies 'Label2' is filled correctly.
Image
But for the TV shows 'Label2' is not filled.
Image
Here is example of my code:
def list_movies():

# Movie item
list_item = xbmcgui.ListItem(label='Movie Item')

list_item.setInfo('video', {'title': 'Movie Item',
'year': 2019,
'mpaa': '18+',
'mediatype': 'movie'})

list_item.setProperty('IsPlayable', 'true')
url = ''
is_folder = False

xbmcplugin.addDirectoryItem(_handle, url, list_item, is_folder)

# Folder settings
xbmcplugin.setContent(_handle, 'movies')
xbmcplugin.setPluginCategory(_handle, 'Movies')
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_NONE, '%Y / %O')

xbmcplugin.endOfDirectory(_handle)


def list_tvshows():

# TV Show item
list_item = xbmcgui.ListItem(label='TV Show Item')

list_item.setInfo('video', {'title': 'TV Show Item',
'year': 2019,
'mpaa': '18+',
'mediatype': 'movie'})

url = ''
is_folder = True

xbmcplugin.addDirectoryItem(_handle, url, list_item, is_folder)

# Folder settings
xbmcplugin.setContent(_handle, 'tvshows')
xbmcplugin.setPluginCategory(_handle, 'TV Shows')
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_NONE, '%Y / %O')

xbmcplugin.endOfDirectory(_handle)
Here is full addon: plugin.video.testlabel2.zip
What I need to do so that 'Label2' is filled for a TV show?
My repository: repository.vlmaksime
Reply
#2
the functionality to set label2 for folder items was recently added to Kodi (16433 (PR)),
so make sure you're running at least Kodi 18.4

i'm not sure which sort methods can be used for tv show folders... but at least this one works:
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_TITLE, '%Y / %O')
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2019-09-29, 19:08)ronie Wrote: so make sure you're running at least Kodi 18.4
I'm using stable build of Kodi 18.4
 
(2019-09-29, 19:08)ronie Wrote: i'm not sure which sort methods can be used for tv show folders... but at least this one works:
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_TITLE, '%Y / %O')
Yes, this sorting method works. But only year value is shown, MPAA value is not showed.
Looks like label2mask value is ignored for folders. When I'm set the sort method to "xbmcplugin.SORT_METHOD_MPAA_RATING" it's show only MPAA value.
My repository: repository.vlmaksime
Reply
#4
Should be fixed by PR #16705
My repository: repository.vlmaksime
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
How to use Label2 for TV Shows?00