From 51e383263f12a01786057832be512ffbad2b43a7 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Thu, 7 Mar 2024 10:55:54 -0400 Subject: [PATCH] Add properties to audiotrack model (#17) --- src/palace_tools/models/api/rwpm_audiobook.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/palace_tools/models/api/rwpm_audiobook.py b/src/palace_tools/models/api/rwpm_audiobook.py index c21045c..6f64875 100644 --- a/src/palace_tools/models/api/rwpm_audiobook.py +++ b/src/palace_tools/models/api/rwpm_audiobook.py @@ -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