# 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


ACTION_SELECTSERIES = 32400

# TODO: Don't use 'imdbnumber'

class SeriesSelector(xbmcgui.WindowXMLDialog):
    def __init__(self, *args, **kwargs):
        super(SeriesSelector, self).__init__(args, kwargs)
        self.serieslist = kwargs.get('serieslist')
        self.originalselected = kwargs.get('selected', [])
        self.selected = []
        self.guilist = None

    def prompt(self):
        self.doModal()
        return self.selected

    def onInit(self):

# 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



ACTION_SELECTSERIES = 32400

# TODO: Don't use 'imdbnumber'

class SeriesSelector(xbmcgui.WindowXMLDialog):
    def __init__(self, *args, **kwargs):
        super(SeriesSelector, self).__init__(args, kwargs)
        self.serieslist = kwargs.get('serieslist')
        self.originalselected = kwargs.get('selected', [])
        self.selected = []
        self.guilist = None

    def prompt(self):
        self.doModal()
        return self.selected

    def onInit(self):

        self.getControl(1).setLabel(L(ACTION_SELECTSERIES))