aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-08 21:47:32 +0300
committerA Farzat <a@farzat.xyz>2026-03-08 21:47:32 +0300
commita349fd340fc63c476358237dbcaafb6ed4a2c521 (patch)
tree866acad0095e0755f57436d11cd9c78a34544b07 /src/models.rs
parentab5ce397987bd97c920101a8d393d0fde29b5f74 (diff)
downloadoreilly-epub-a349fd340fc63c476358237dbcaafb6ed4a2c521.tar.gz
oreilly-epub-a349fd340fc63c476358237dbcaafb6ed4a2c521.zip
Remove unused models, fields, and endpoints
If they are ever needed again, they can be added back. Also set API endpoints fields to Url type instead of String.
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/models.rs b/src/models.rs
index 5f92d03..806d746 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -5,7 +5,7 @@ use url::Url;
/// Generic Model for paginated API.
#[derive(Debug, serde::Deserialize)]
pub struct Paginated<T> {
- pub next: Option<String>,
+ pub next: Option<Url>,
pub results: Vec<T>,
}
@@ -15,10 +15,8 @@ pub struct EpubResponse {
pub publication_date: String,
pub title: String,
pub descriptions: Descriptions,
- 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
+ pub chapters: Url,
+ pub files: Url,
pub language: String,
}
@@ -34,7 +32,6 @@ pub struct Descriptions {
pub struct Chapter {
pub ourn: String,
pub title: String,
- pub is_skippable: bool,
pub related_assets: ChapRelAssets,
}
@@ -51,26 +48,5 @@ pub struct FileEntry {
pub url: Url,
pub full_path: RelativePathBuf,
pub media_type: String,
- pub filename: String,
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>,
}