From 7ff459dc3bc5b9d0ed8c067cce443b2ee55186c8 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Mon, 2 Mar 2026 16:38:10 +0300 Subject: Add fetching of the spine and table of contents --- src/models.rs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/models.rs') diff --git a/src/models.rs b/src/models.rs index 843744d..2809711 100644 --- a/src/models.rs +++ b/src/models.rs @@ -20,8 +20,10 @@ pub struct SearchResult { #[derive(Debug, Deserialize)] pub struct EpubResponse { pub publication_date: String, - pub chapters: String, // This is a URL to the chapters list - pub files: String, // This is a URL to the resource files + pub chapters: String, // This is a URL to the chapters list + pub files: String, // This is a URL to the resource files + pub spine: String, // This is a URL to the spine list + pub table_of_contents: String, // This is a URL to the table of contents } /// Model for chapters API. @@ -42,3 +44,22 @@ pub struct FileEntry { pub filename_ext: String, pub kind: String, } + +/// Model for spine API. +#[derive(Debug, Deserialize)] +pub struct SpineItem { + pub ourn: String, + pub reference_id: String, + pub title: String, +} + +/// Model for table of contents API. +#[derive(Debug, Deserialize)] +pub struct TocNode { + pub depth: u32, + pub reference_id: String, + pub ourn: String, + pub fragment: String, + pub title: String, + pub children: Vec, +} -- cgit v1.2.3-70-g09d2