summaryrefslogtreecommitdiff
path: root/src/ampache/models.py
blob: 2e0ed1b8a6bd05016e07ee5363bb943482216bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
The data structures of the ampache API (songs, artists, albums, etc).
"""
from dataclasses import dataclass
import datetime


@dataclass
class AuthToken:
    expires: datetime.datetime
    auth: str

    def __str__(self):
        return f"Expires: {self.expires}\nToken: {self.auth}"


@dataclass
class Song:
    song_id: str
    title: str
    album: str
    artist: str

    def __str__(self):
        return f"{self.title} by {self.artist}"