Exemplo n.º 1
0
def queue():
    ret = []

    with remote() as r:
        for item in r.queue():
            ret.append(int(item))

    return ret
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
def current():
    with remote() as r:
        current = r.current()
    return current if current is not None else -1
Exemplo n.º 6
0
def available(mrl, backend) -> bool:
    available = True
    with remote() as r:
        available = r.available(mrl, backend)

    return available != False
Exemplo n.º 7
0
def stop():
    with remote() as r:
        r.stop()
Exemplo n.º 8
0
def pause():
    with remote() as r:
        r.pause()
Exemplo n.º 9
0
def play_next():
    with remote() as r:
        r.play_next()
Exemplo n.º 10
0
def play():
    with remote() as r:
        r.play()
Exemplo n.º 11
0
def get_status():
    with remote() as r:
        status = r.status()
    return status