type.py 299 B

1234567891011121314151617181920
  1. from dataclasses import dataclass
  2. from typing import Literal
  3. @dataclass
  4. class Track:
  5. type: Literal["track"]
  6. audio_url: str
  7. meta_url: str
  8. number: int
  9. timecode: str
  10. @dataclass
  11. class Album:
  12. type: Literal["album"]
  13. audio_url: str
  14. meta_url: str
  15. tracks: list[Track]