Compare commits
2 commits
e8a068b66a
...
5b703310ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b703310ba | ||
| 47c039cc71 |
6 changed files with 26 additions and 28 deletions
32
Cargo.lock
generated
32
Cargo.lock
generated
|
|
@ -2052,9 +2052,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "progenitor"
|
name = "progenitor"
|
||||||
version = "0.8.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "293df5b79211fbf0c1ebad6513ba451d267e9c15f5f19ee5d3da775e2dd27331"
|
checksum = "d7b99ef43fdd69d70aa4df8869db24b10ac704a2dbbc387ffac51944a1f3c0a8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"progenitor-client",
|
"progenitor-client",
|
||||||
"progenitor-impl",
|
"progenitor-impl",
|
||||||
|
|
@ -2063,9 +2063,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "progenitor-client"
|
name = "progenitor-client"
|
||||||
version = "0.8.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4a5db54eac3cae7007a0785854bc3e89fd418cca7dfc2207b99b43979154c1b"
|
checksum = "3832a961a5f1b0b5a5ccda5fbf67cae2ba708f6add667401007764ba504ffebf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
|
@ -2078,9 +2078,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "progenitor-impl"
|
name = "progenitor-impl"
|
||||||
version = "0.8.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d85934a440963a69f9f04f48507ff6e7aa2952a5b2d8f96cc37fa3dd5c270f66"
|
checksum = "7646201b823e61712dd72f37428ceecaa8fb2a6c841e5d7cf909edb9a17f5677"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"http 1.3.1",
|
"http 1.3.1",
|
||||||
|
|
@ -2093,16 +2093,16 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"syn 2.0.104",
|
"syn 2.0.104",
|
||||||
"thiserror 1.0.69",
|
"thiserror 2.0.12",
|
||||||
"typify",
|
"typify",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "progenitor-macro"
|
name = "progenitor-macro"
|
||||||
version = "0.8.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d99a5a259e2d65a4933054aa51717c70b6aba0522695731ac354a522124efc9b"
|
checksum = "e710a11140d9b4241b7d8a90748f6125b6796d7a1205238eddb08dc790ce3830"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"openapiv3",
|
"openapiv3",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -3035,9 +3035,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typify"
|
name = "typify"
|
||||||
version = "0.2.0"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4c644dda9862f0fef3a570d8ddb3c2cfb1d5ac824a1f2ddfa7bc8f071a5ad8a"
|
checksum = "6c6c647a34e851cf0260ccc14687f17cdcb8302ff1a8a687a24b97ca0f82406f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"typify-impl",
|
"typify-impl",
|
||||||
"typify-macro",
|
"typify-macro",
|
||||||
|
|
@ -3045,9 +3045,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typify-impl"
|
name = "typify-impl"
|
||||||
version = "0.2.0"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d59ab345b6c0d8ae9500b9ff334a4c7c0d316c1c628dc55726b95887eb8dbd11"
|
checksum = "741b7f1e2e1338c0bee5ad5a7d3a9bbd4e24c33765c08b7691810e68d879365d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -3059,15 +3059,15 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"syn 2.0.104",
|
"syn 2.0.104",
|
||||||
"thiserror 1.0.69",
|
"thiserror 2.0.12",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typify-macro"
|
name = "typify-macro"
|
||||||
version = "0.2.0"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "785e2cdcef0df8160fdd762ed548a637aaec1e83704fdbc14da0df66013ee8d0"
|
checksum = "7560adf816a1e8dad7c63d8845ef6e31e673e39eab310d225636779230cbedeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ figment_file_provider_adapter = "0.1.1"
|
||||||
log = "0.4.22"
|
log = "0.4.22"
|
||||||
multimap = "0.10.0"
|
multimap = "0.10.0"
|
||||||
pretty_env_logger = "0.5.0"
|
pretty_env_logger = "0.5.0"
|
||||||
progenitor-client = "0.8.0"
|
progenitor-client = "0.11.0"
|
||||||
readonly = "0.2.12"
|
readonly = "0.2.12"
|
||||||
regress = "0.10.1"
|
regress = "0.10.1"
|
||||||
reqwest = { version = "0.12.8", features = ["json", "stream"] }
|
reqwest = { version = "0.12.8", features = ["json", "stream"] }
|
||||||
|
|
@ -37,7 +37,7 @@ vcard4 = "0.5.2"
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
openapiv3 = "2.0.0"
|
openapiv3 = "2.0.0"
|
||||||
prettyplease = "0.2.24"
|
prettyplease = "0.2.24"
|
||||||
progenitor = "0.8.0"
|
progenitor = "0.11.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
syn = "2.0"
|
syn = "2.0"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ pub async fn auto_create_albums(ctx: Context, separator: String) -> Result<()> {
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
info!("Creating missing albums: {:?}", missing_albums);
|
info!("Creating missing albums: {missing_albums:?}");
|
||||||
|
|
||||||
for missing_album in &missing_albums {
|
for missing_album in &missing_albums {
|
||||||
let assets = sorted_assets
|
let assets = sorted_assets
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,7 @@ pub async fn sync_date_of_birth(ctx: Context, vcard_file: &PathBuf) -> Result<()
|
||||||
let bday = vcard_date_to_naive_date(dt.value.first().unwrap().clone())?;
|
let bday = vcard_date_to_naive_date(dt.value.first().unwrap().clone())?;
|
||||||
if c.date_of_birth.as_ref().is_some_and(|bdate| bday == *bdate) {
|
if c.date_of_birth.as_ref().is_some_and(|bdate| bday == *bdate) {
|
||||||
debug!(
|
debug!(
|
||||||
"{} already has the proper date of birth, skipping",
|
"{formatted_name} already has the proper date of birth, skipping"
|
||||||
formatted_name
|
|
||||||
);
|
);
|
||||||
} else if bday.year() > 0 {
|
} else if bday.year() > 0 {
|
||||||
UpdatePersonDateOfBirth::new(UpdatePersonDateOfBirthArgs {
|
UpdatePersonDateOfBirth::new(UpdatePersonDateOfBirthArgs {
|
||||||
|
|
@ -68,8 +67,7 @@ pub async fn sync_date_of_birth(ctx: Context, vcard_file: &PathBuf) -> Result<()
|
||||||
updated_dobs += 1;
|
updated_dobs += 1;
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
"{} has an incomplete date of birth, skipping",
|
"{formatted_name} has an incomplete date of birth, skipping"
|
||||||
formatted_name
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -77,14 +75,14 @@ pub async fn sync_date_of_birth(ctx: Context, vcard_file: &PathBuf) -> Result<()
|
||||||
todo!("{}: DateTimeOrTextProperty({})", formatted_name, prop)
|
todo!("{}: DateTimeOrTextProperty({})", formatted_name, prop)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => debug!("No Immich match for {}", formatted_name),
|
None => debug!("No Immich match for {formatted_name}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => todo!(),
|
None => todo!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Updated {} persons", updated_dobs);
|
info!("Updated {updated_dobs} persons");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ async fn main() -> Result<()> {
|
||||||
if let Some(project_dirs) = ProjectDirs::from("fr", "enoent", "Immich Tools") {
|
if let Some(project_dirs) = ProjectDirs::from("fr", "enoent", "Immich Tools") {
|
||||||
let config_file_path = project_dirs.config_dir().join("config.toml");
|
let config_file_path = project_dirs.config_dir().join("config.toml");
|
||||||
if config_file_path.exists() {
|
if config_file_path.exists() {
|
||||||
debug!("Reading configuration from {:?}", config_file_path);
|
debug!("Reading configuration from {config_file_path:?}");
|
||||||
conf_extractor =
|
conf_extractor =
|
||||||
conf_extractor.merge(FileAdapter::wrap(Toml::file_exact(config_file_path)));
|
conf_extractor.merge(FileAdapter::wrap(Toml::file_exact(config_file_path)));
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +135,7 @@ async fn validate_client_connection(client: &Client) -> Result<()> {
|
||||||
.with_note(|| {
|
.with_note(|| {
|
||||||
format!(
|
format!(
|
||||||
"The API version for this client is {}, make sure the server version is compatible",
|
"The API version for this client is {}, make sure the server version is compatible",
|
||||||
client.api_version()
|
Client::api_version()
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ pub struct AssetQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn fetch_all_assets(query: AssetQuery, client: &Client) -> Result<Vec<AssetResponseDto>> {
|
pub async fn fetch_all_assets(query: AssetQuery, client: &Client) -> Result<Vec<AssetResponseDto>> {
|
||||||
debug!("Fetching assets with query {:?}", query);
|
debug!("Fetching assets with query {query:?}");
|
||||||
|
|
||||||
// is_offline is ignored, let's fetch trashed assets instead and filter them later
|
// is_offline is ignored, let's fetch trashed assets instead and filter them later
|
||||||
let trashed_after = if query.is_offline == Some(true) {
|
let trashed_after = if query.is_offline == Some(true) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue