Ejemplo n.º 1
0
 def dispatch_request(self, cmd, song_id=None):
     if cmd == "play":
         return getattr(self, "_play")(song_id)
     if cmd in self.allowed_commands:
         logger.info("calling: " + cmd)
         return getattr(self, "_" + cmd)()
     raise Exception("Invalid command")
Ejemplo n.º 2
0
 def play_stream(self, url):
     logger.info("Playing stream: " + url)
     with self._lock:
         self._client.stop()
         self._client.clear()
         self._client.add(url)
         self._client.play()
     logger.info("OK!")
Ejemplo n.º 3
0
    def _select_station(self, mi):
        logger.info("tuning in: " + mi.identifier)

        f = self._sc.tune_in(mi.identifier)
        (url, is_stream) = self._find_url(f)
        self.plugin_pmpd.play_stream(url)