From 10f1db4541e40ef776e41f572ff07a5ed64205ca Mon Sep 17 00:00:00 2001 From: A Farzat Date: Mon, 2 Mar 2026 13:24:38 +0300 Subject: Add file and chapter details fetching Fetching file details allows us to download them to the correct location later. Chapter details are currently limited to is_skippable, which might be used to determine whether to make the corresponding spine item non-linear. Other details such as the title shall be fetched from the spine and table-of-contents endpoints later. --- src/models.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/models.rs') diff --git a/src/models.rs b/src/models.rs index 77afeb2..174b983 100644 --- a/src/models.rs +++ b/src/models.rs @@ -23,3 +23,30 @@ pub struct EpubResponse { pub chapters: String, // This is a URL to the chapters list pub files: String, // This is a URL to the resource files } + +// --- Generic Model for paginated API --- + +#[derive(Debug, serde::Deserialize)] +pub struct Paginated { + pub next: Option, + pub results: Vec, +} + +/// Model for chapters API. +#[derive(Debug, Deserialize)] +pub struct Chapter { + pub ourn: String, + pub is_skippable: bool, +} + +/// Model for files API. +#[derive(Debug, Deserialize)] +pub struct FileEntry { + pub ourn: String, + pub url: String, + pub full_path: String, + pub media_type: String, + pub filename: String, + pub filename_ext: String, + pub kind: String, +} -- cgit v1.2.3-70-g09d2