aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-02 16:38:10 +0300
committerA Farzat <a@farzat.xyz>2026-03-02 16:38:10 +0300
commit7ff459dc3bc5b9d0ed8c067cce443b2ee55186c8 (patch)
tree1eb3a0f17b4c1ffa93764db5fc9621783a4785aa /src/models.rs
parent1cc32c35edaf6b8c2f468c22ccf61f3f07027e81 (diff)
downloadoreilly-epub-7ff459dc3bc5b9d0ed8c067cce443b2ee55186c8.tar.gz
oreilly-epub-7ff459dc3bc5b9d0ed8c067cce443b2ee55186c8.zip
Add fetching of the spine and table of contents
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs25
1 files changed, 23 insertions, 2 deletions
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<TocNode>,
+}