Skip to content

Commit

Permalink
added image type webp
Browse files Browse the repository at this point in the history
  • Loading branch information
9FS committed Nov 10, 2024
1 parent a30ee4f commit 7aab2d7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 37 deletions.
76 changes: 41 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
name = "nhentai_archivist"
readme = "readme.md"
repository = "https://github.com/9-FS/nhentai_archivist"
version = "3.5.0"
version = "3.5.1"

[dependencies]
chrono = { version = "^0.4.0", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
nhentai_archivist:
container_name: "nhentai_archivist"
image: "ghcr.io/9-fs/nhentai_archivist:3.5.0"
image: "ghcr.io/9-fs/nhentai_archivist:3.5.1"
environment:
HOST_OS: "Unraid"
TZ: "UTC"
Expand Down
4 changes: 4 additions & 0 deletions src/api_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ pub enum ImageType
Gif,
Jpg,
Png,
Webp,
}

impl<'de> serde::Deserialize<'de> for ImageType
Expand Down Expand Up @@ -169,6 +170,7 @@ impl std::fmt::Debug for ImageType
Self::Gif => "g", // only short form in program context (database)
Self::Jpg => "j",
Self::Png => "p",
Self::Webp => "w",
}
);
}
Expand All @@ -184,6 +186,7 @@ impl std::fmt::Display for ImageType
Self::Gif => "gif", // long form for output
Self::Jpg => "jpg",
Self::Png => "png",
Self::Webp => "webp",
}
);
}
Expand All @@ -199,6 +202,7 @@ impl std::str::FromStr for ImageType
"g" | "gif" => Self::Gif,
"j" | "jpg" => Self::Jpg,
"p" | "png" => Self::Png,
"w" | "webp" => Self::Webp,
_ => return Err(format!("Invalid image type: \"{s}\"")),
};
return Ok(image_type);
Expand Down

0 comments on commit 7aab2d7

Please sign in to comment.