From 74b01c4942e38afce9efdf60fa46ab573f4f6f86 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 14 May 2022 14:39:45 -0500 Subject: Commit inicial --- src/ampache/models.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/ampache/models.py (limited to 'src/ampache/models.py') diff --git a/src/ampache/models.py b/src/ampache/models.py new file mode 100644 index 0000000..2e0ed1b --- /dev/null +++ b/src/ampache/models.py @@ -0,0 +1,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}" -- cgit v1.2.3