Make most song info optional, to support untagged music
This commit is contained in:
parent
88a38a1bbd
commit
9ff488d807
4 changed files with 105 additions and 55 deletions
|
@ -1,5 +1,7 @@
|
|||
from enum import StrEnum
|
||||
from pathlib import Path
|
||||
from typing import Protocol
|
||||
from uuid import UUID
|
||||
|
||||
from attrs import define, field
|
||||
|
||||
|
@ -13,10 +15,18 @@ class PlaybackState(StrEnum):
|
|||
@define
|
||||
class Song:
|
||||
state: PlaybackState
|
||||
title: str
|
||||
artist: str
|
||||
album: str
|
||||
album_artist: str
|
||||
queue_index: int
|
||||
queue_length: int
|
||||
file: Path
|
||||
musicbrainz_trackid: UUID | None
|
||||
title: str | None
|
||||
artist: str | None
|
||||
composer: str | None
|
||||
album: str | None
|
||||
album_artist: str | None
|
||||
track: int | None
|
||||
disc: int | None
|
||||
genre: str | None
|
||||
duration: float
|
||||
elapsed: float
|
||||
art: bytes | None = field(repr=lambda a: "<has art>" if a else "<no art>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue