Example #1
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self._scanner = scan.Scanner(timeout=config['stream']['timeout'],
                                     proxy_config=config['proxy'])

        self._session = http.get_requests_session(
            proxy_config=config['proxy'],
            user_agent='%s/%s' %
            (stream.Extension.dist_name, stream.Extension.version))

        blacklist = config['stream']['metadata_blacklist']
        self._blacklist_re = re.compile(
            r'^(%s)$' % '|'.join(fnmatch.translate(u) for u in blacklist))

        self._timeout = config['stream']['timeout']

        self.library = StreamLibraryProvider(backend=self)
        self.playback = StreamPlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])

        if 'file' in self.uri_schemes and config['file']['enabled']:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                'Please remove it from the stream/protocols config.')
            self.uri_schemes -= {'file'}
Example #2
0
    def __init__(self, config, audio):
        super().__init__()

        self._scanner = scan.Scanner(timeout=config["stream"]["timeout"],
                                     proxy_config=config["proxy"])

        self._session = http.get_requests_session(
            proxy_config=config["proxy"],
            user_agent=(
                f"{stream.Extension.dist_name}/{stream.Extension.version}"),
        )

        blacklist = config["stream"]["metadata_blacklist"]
        self._blacklist_re = re.compile(
            r"^(%s)$" % "|".join(fnmatch.translate(u) for u in blacklist))

        self._timeout = config["stream"]["timeout"]

        self.library = StreamLibraryProvider(backend=self)
        self.playback = StreamPlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config["stream"]["protocols"])

        if "file" in self.uri_schemes and config["file"]["enabled"]:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                "Please remove it from the stream/protocols config.")
            self.uri_schemes -= {"file"}
Example #3
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self._scanner = scan.Scanner(timeout=config["stream"]["timeout"], proxy_config=config["proxy"])

        self._session = http.get_requests_session(
            proxy_config=config["proxy"], user_agent="%s/%s" % (stream.Extension.dist_name, stream.Extension.version)
        )

        blacklist = config["stream"]["metadata_blacklist"]
        self._blacklist_re = re.compile(r"^(%s)$" % "|".join(fnmatch.translate(u) for u in blacklist))

        self._timeout = config["stream"]["timeout"]

        self.library = StreamLibraryProvider(backend=self)
        self.playback = StreamPlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(config["stream"]["protocols"])

        if "file" in self.uri_schemes and config["file"]["enabled"]:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                "Please remove it from the stream/protocols config."
            )
            self.uri_schemes -= {"file"}
Example #4
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self._scanner = scan.Scanner(
            timeout=config['stream']['timeout'],
            proxy_config=config['proxy'])

        self._session = http.get_requests_session(
            proxy_config=config['proxy'],
            user_agent='%s/%s' % (
                stream.Extension.dist_name, stream.Extension.version))

        blacklist = config['stream']['metadata_blacklist']
        self._blacklist_re = re.compile(
            r'^(%s)$' % '|'.join(fnmatch.translate(u) for u in blacklist))

        self._timeout = config['stream']['timeout']

        self.library = StreamLibraryProvider(backend=self)
        self.playback = StreamPlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])

        if 'file' in self.uri_schemes and config['file']['enabled']:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                'Please remove it from the stream/protocols config.')
            self.uri_schemes -= {'file'}
Example #5
0
    def __init__(self, audio):
        super(StreamBackend, self).__init__()

        self.library = StreamLibraryProvider(backend=self)
        self.playback = base.BasePlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            settings.STREAM_PROTOCOLS)
Example #6
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self.library = StreamLibraryProvider(backend=self)
        self.playback = base.BasePlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])
Example #7
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self.library = StreamLibraryProvider(
            backend=self, timeout=config['stream']['timeout'],
            blacklist=config['stream']['metadata_blacklist'])
        self.playback = backend.PlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])
Example #8
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self.library = StreamLibraryProvider(
            backend=self,
            timeout=config['stream']['timeout'],
            blacklist=config['stream']['metadata_blacklist'])
        self.playback = backend.PlaybackProvider(audio=audio, backend=self)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])
Example #9
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self._scanner = scan.Scanner(timeout=config['stream']['timeout'],
                                     proxy_config=config['proxy'])

        self.library = StreamLibraryProvider(
            backend=self, blacklist=config['stream']['metadata_blacklist'])
        self.playback = StreamPlaybackProvider(audio=audio,
                                               backend=self,
                                               config=config)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])

        if 'file' in self.uri_schemes and config['file']['enabled']:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                'Please remove it from the stream/protocols config.')
            self.uri_schemes -= {'file'}
Example #10
0
    def __init__(self, config, audio):
        super(StreamBackend, self).__init__()

        self._scanner = scan.Scanner(
            timeout=config['stream']['timeout'],
            proxy_config=config['proxy'])

        self.library = StreamLibraryProvider(
            backend=self, blacklist=config['stream']['metadata_blacklist'])
        self.playback = StreamPlaybackProvider(
            audio=audio, backend=self, config=config)
        self.playlists = None

        self.uri_schemes = audio_lib.supported_uri_schemes(
            config['stream']['protocols'])

        if 'file' in self.uri_schemes and config['file']['enabled']:
            logger.warning(
                'The stream/protocols config value includes the "file" '
                'protocol. "file" playback is now handled by Mopidy-File. '
                'Please remove it from the stream/protocols config.')
            self.uri_schemes -= {'file'}