# Path: lib/libs/pykodi.py
# def localize(messageid):
#     if isinstance(messageid, basestring):
#         result = messageid
#     elif messageid >= 32000 and messageid < 33000:
#         result = get_main_addon().getLocalizedString(messageid)
#     else:
#         result = xbmc.getLocalizedString(messageid)
#     return result.encode('utf-8') if isinstance(result, unicode) else result


import xbmcgui
from lib.libs.pykodi import localize as L
        self.getControl(3).setVisible(False)
        self.getControl(5).setVisible(True)
        self.getControl(5).setLabel('$LOCALIZE[186]')
        self.guilist = self.getControl(6)
        self.guilist.setVisible(True)

        for series in self.serieslist:
            listitem = xbmcgui.ListItem(series['label'])
            summary = str(series['year']) + ' - ' + series['plot']
            listitem.setLabel2(summary)
            # DEPRECATED: Above Krypton and higher (only), below Jarvis and lower (only)
            listitem.setProperty('Addon.Summary', summary)
            listitem.setProperty('imdbnumber', series['imdbnumber'])
            art = series['art']
            if 'poster' in series['art']:
                art['thumb'] = series['art']['poster']
            listitem.setArt(art)
            if series['imdbnumber'] in self.originalselected:
                listitem.select(True)
                self.selected.append(series['imdbnumber'])
            self.guilist.addItem(listitem)
        self.originalselected = list(self.selected)
        self.setFocus(self.guilist)

    def onClick(self, controlid):
        if controlid == 6:
            item = self.guilist.getSelectedItem()
            if item.isSelected():
                item.select(False)
                self.selected.remove(item.getProperty('imdbnumber'))

# Path: lib/libs/pykodi.py
# def localize(messageid):
#     if isinstance(messageid, basestring):
#         result = messageid
#     elif messageid >= 32000 and messageid < 33000:
#         result = get_main_addon().getLocalizedString(messageid)
#     else:
#         result = xbmc.getLocalizedString(messageid)
#     return result.encode('utf-8') if isinstance(result, unicode) else result


# Path: lib/seriesselection.py
import xbmcgui
from lib.libs.pykodi import localize as L

        self.getControl(3).setVisible(False)
        self.getControl(5).setVisible(True)
        self.getControl(5).setLabel('$LOCALIZE[186]')
        self.guilist = self.getControl(6)
        self.guilist.setVisible(True)

        for series in self.serieslist:
            listitem = xbmcgui.ListItem(series['label'])
            summary = str(series['year']) + ' - ' + series['plot']
            listitem.setLabel2(summary)
            # DEPRECATED: Above Krypton and higher (only), below Jarvis and lower (only)
            listitem.setProperty('Addon.Summary', summary)
            listitem.setProperty('imdbnumber', series['imdbnumber'])
            art = series['art']
            if 'poster' in series['art']:
                art['thumb'] = series['art']['poster']
            listitem.setArt(art)
            if series['imdbnumber'] in self.originalselected:
                listitem.select(True)
                self.selected.append(series['imdbnumber'])
            self.guilist.addItem(listitem)
        self.originalselected = list(self.selected)
        self.setFocus(self.guilist)

    def onClick(self, controlid):
        if controlid == 6:
            item = self.guilist.getSelectedItem()
            if item.isSelected():
                item.select(False)
                self.selected.remove(item.getProperty('imdbnumber'))

            else: