Files
swingmusic-extended/swingmusic/models/favorite.py
T
cwilvx 86fabcd5e3 modularize src
+ merge main.py and manage.py
+ move start logic to swingmusic/__main__.py
+ add a run.py on the project root
2025-05-25 20:35:54 +03:00

16 lines
352 B
Python

from dataclasses import dataclass
from typing import Any, Literal
@dataclass
class Favorite:
hash: str
type: Literal["album", "track", "artist"]
timestamp: int
userid: int
extra: dict[str, Any]
def __post_init__(self):
# remove the type prefix from the hash
self.hash = self.hash.replace(f"{self.type}_", "")