예제 #1
0
파일: views.py 프로젝트: dderichs/piradio
 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")
예제 #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!")
예제 #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)