mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(types): expose the book file id on audiobook manifest assets
Clients that download an audiobook get its files from the book detail and its playback order from the manifest, and had to pair the two by position. The two lists are ordered differently, so an index pairing can attach the wrong file to an asset. Add the book_files id to each manifest asset so the pairing can be made by id. The field is additive and the server always sends it. The manifest revision is hashed from file and chapter data, not from the response, so existing revisions do not change and clients holding one do not see a 412 from this deploy. The iOS app consumes this field to pair downloaded files with manifest assets; the web client does not read it yet, so a grep of the client alone will show it as unused.
This commit is contained in:
@@ -8,6 +8,8 @@ export const AUDIOBOOK_MANIFEST_VERSION = 2 as const;
|
||||
|
||||
export interface AudiobookManifestAsset {
|
||||
assetId: string;
|
||||
/** The book file id, matching `BookDetail.files[].id`, so clients can pair an asset with its file. */
|
||||
fileId: number;
|
||||
sequence: number;
|
||||
format: string;
|
||||
durationMs: number | null;
|
||||
|
||||
Reference in New Issue
Block a user