From 7aab2d747990adb90f67ae886d57ca6c5e4dd783 Mon Sep 17 00:00:00 2001 From: 9FS Date: Sun, 10 Nov 2024 18:41:44 +0000 Subject: [PATCH] added image type webp --- Cargo.lock | 76 ++++++++++++++++++++++++--------------------- Cargo.toml | 2 +- docker-compose.yaml | 2 +- src/api_response.rs | 4 +++ 4 files changed, 47 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15fe67c..a104f53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,12 +277,13 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" dependencies = [ "cookie", - "idna 0.5.0", + "document-features", + "idna 1.0.3", "log", "publicsuffix", "serde", @@ -416,6 +417,15 @@ dependencies = [ "syn", ] +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -957,16 +967,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -1098,6 +1098,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "load_config" version = "1.2.1" @@ -1105,7 +1111,7 @@ source = "git+https://github.com/9-FS/load_config?tag=1.2.1#bac9926753124cef7b7b dependencies = [ "figment", "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", "toml", ] @@ -1192,7 +1198,7 @@ dependencies = [ [[package]] name = "nhentai_archivist" -version = "3.5.0" +version = "3.5.1" dependencies = [ "chrono", "load_config", @@ -1204,7 +1210,7 @@ dependencies = [ "serde_json", "setup_logging", "sqlx", - "thiserror 2.0.1", + "thiserror 2.0.2", "tokio", "unicode-segmentation", "zip", @@ -1476,7 +1482,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -1493,7 +1499,7 @@ dependencies = [ "rustc-hash", "rustls", "slab", - "thiserror 1.0.68", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -1653,9 +1659,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags", "errno", @@ -1742,7 +1748,7 @@ checksum = "fb3aa78ecda1ebc9ec9847d5d3aba7d618823446a049ba2491940506da6e2782" dependencies = [ "log", "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", "xml-rs", ] @@ -1950,7 +1956,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -2035,7 +2041,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "whoami", ] @@ -2074,7 +2080,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "whoami", ] @@ -2172,27 +2178,27 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.68", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c1e40dd48a282ae8edc36c732cbc219144b87fb6a4c7316d611c6b1f06ec0c" +checksum = "037e29b009aa709f293b974da5cd33b15783c049e07f8435778ce8c4871525d8" dependencies = [ - "thiserror-impl 2.0.1", + "thiserror-impl 2.0.2", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -2201,9 +2207,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874aa7e446f1da8d9c3a5c95b1c5eb41d800045252121dc7f8e0ba370cee55f5" +checksum = "ea4778c7e8ff768bdb32a58a2349903859fe719a320300d7d4ce8636f19a1e69" dependencies = [ "proc-macro2", "quote", @@ -2965,7 +2971,7 @@ dependencies = [ "pbkdf2", "rand", "sha1", - "thiserror 1.0.68", + "thiserror 1.0.69", "time", "zeroize", "zopfli", diff --git a/Cargo.toml b/Cargo.toml index 30abfc1..885ac0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/docker-compose.yaml b/docker-compose.yaml index e2445e3..81e8bae 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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" diff --git a/src/api_response.rs b/src/api_response.rs index e4cb353..8a3f5a0 100644 --- a/src/api_response.rs +++ b/src/api_response.rs @@ -131,6 +131,7 @@ pub enum ImageType Gif, Jpg, Png, + Webp, } impl<'de> serde::Deserialize<'de> for ImageType @@ -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", } ); } @@ -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", } ); } @@ -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);