Files
swingmusic-extended/app/models/favorite.py
T
cwilvx 620974561c fix: removing favorites not being commited to db
+ improve: collision of hashes on the favorite table
+ rename pages to collections
+ bump mix sleep time from 6hrs to 12hrs
2025-02-25 23:30:51 +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}_", "")