def queue(): ret = [] with remote() as r: for item in r.queue(): ret.append(int(item)) return ret
def remove(track_id: int) -> None: """ » Subscribed to queue_remove Removes a track from the queue by it's id :param track_id: The track's id :return: None """ with remote() as r: r.remove(track_id)
def test_queue_add_one(self): payload = {"track_id": "14"} response = requests.post("http://127.0.0.1:5000/queue/add", data=payload).json() self.assertEqual(response["success"], True) with remote() as r: r.clear()
def add(track_id: int, user_token: str) -> None: """ » Subscribed to queue_add Adds a track to the queue by it's id :param user_token: The user token of the user who added this track :param track_id: The track's id :return: None """ track = tracks.get(track_id) with remote() as r: r.add(track_id, track.mrl, track.backend)
def current(): with remote() as r: current = r.current() return current if current is not None else -1
def available(mrl, backend) -> bool: available = True with remote() as r: available = r.available(mrl, backend) return available != False
def stop(): with remote() as r: r.stop()
def pause(): with remote() as r: r.pause()
def play_next(): with remote() as r: r.play_next()
def play(): with remote() as r: r.play()
def get_status(): with remote() as r: status = r.status() return status