rust impl

This commit is contained in:
2026-07-23 21:42:52 +02:00
parent 94d55007fb
commit 29733272e3
3 changed files with 101 additions and 1 deletions
Generated
+82
View File
@@ -2,6 +2,88 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 4 version = 4
[[package]]
name = "dotenvy"
version = "0.15.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
[[package]] [[package]]
name = "immich-extern-to-album" name = "immich-extern-to-album"
version = "0.1.0" version = "0.1.0"
dependencies = [
"dotenvy",
"log",
"serde",
]
[[package]]
name = "log"
version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "serde"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "syn"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
+3
View File
@@ -4,3 +4,6 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
dotenvy = "0.15.7"
log = "0.4.33"
serde = { version = "1.0.228", features = ["derive"] }
+16 -1
View File
@@ -1,3 +1,18 @@
use std::env;
struct AppState {
immich_url: String,
immich_api_key: String,
libary_id: String,
external_root: String,
}
fn main() { fn main() {
println!("Hello, world!"); let app_state = AppState {
immich_url: env::var("IMMICH_URL").unwrap_or_else(|_| "".to_string()),
immich_api_key: env::var("IMMICH_API_KEY").unwrap_or_else(|_| "".to_string()),
libary_id: env::var("IMMICH_LIBRARY_ID").unwrap_or_else(|_| "".to_string()),
external_root: env
::var("EXTERNAL_ROOT")
.unwrap_or_else(|_| "/mnt/nextcloud-photos".to_string()),
};
} }