Skip to content

Commit

Permalink
Add properties to audiotrack model (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen authored Mar 7, 2024
1 parent 333401a commit 51e3832
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/palace_tools/models/api/rwpm_audiobook.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,23 @@ def from_track(cls, track: AudioTrack, default_title: str = "Track") -> Self:
ToCEntries = Sequence[ToCEntry]


class AudioTrackEncryption(BaseModel):
scheme: str
algorithm: str
profile: str


class AudioTrackProperties(BaseModel):
encrypted: AudioTrackEncryption | None = None


class AudioTrack(BaseModel):
title: str | None = None
href: str
content_type: str = Field(..., alias="type")
duration: int # in seconds
bitrate: int | None = None
properties: AudioTrackProperties | None = None

# Optional property, initialized after the model is created, if
# we have the source file, this is the actual duration as read from the
Expand Down

0 comments on commit 51e3832

Please sign in to comment.