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

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

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

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