Пример #1
0
    def __init__(self, provider: xbmcmediaimport.MediaProvider):
        if not provider:
            raise ValueError('Invalid provider')

        self._id = provider.getIdentifier()
        self._url = provider.getBasePath()

        settings = provider.getSettings()
        if not settings:
            raise ValueError('Invalid provider without settings')

        self._localOnly = bool(
            settings.getInt(SETTINGS_PROVIDER_AUTHENTICATION) ==
            SETTINGS_PROVIDER_AUTHENTICATION_OPTION_LOCAL)
        self._token = ""
        if not self._localOnly:
            self._token = settings.getString(SETTINGS_PROVIDER_TOKEN)
        self._plex = None
Пример #2
0
    def __init__(self, provider: xbmcmediaimport.MediaProvider):
        if not provider:
            raise ValueError('Invalid provider')

        self._id = provider.getIdentifier()

        settings = provider.getSettings()
        if not settings:
            raise ValueError('Invalid provider without settings')

        self._url = ProviderSettings.GetUrl(settings)

        self._localOnly = bool(
            ProviderSettings.GetAuthenticationMethod(settings) ==
            SETTINGS_PROVIDER_AUTHENTICATION_OPTION_LOCAL)
        self._token = ""
        if not self._localOnly:
            self._token = ProviderSettings.GetAccessToken(settings)
        self._plex = None