diff --git a/crates/dtmm/src/controller/import.rs b/crates/dtmm/src/controller/import.rs index 522d94a..68f2b05 100644 --- a/crates/dtmm/src/controller/import.rs +++ b/crates/dtmm/src/controller/import.rs @@ -234,6 +234,8 @@ fn extract_mod_config(archive: &mut ZipArchive) -> Result<(Mo None }; + tracing::debug!(?legacy_mod_data); + if let Some(name) = find_archive_file(archive, "dtmt.cfg") { let mut f = archive .by_name(&name) @@ -266,6 +268,24 @@ fn extract_mod_config(archive: &mut ZipArchive) -> Result<(Mo Ok((cfg, root)) } + } else if let Some((mod_id, resources, root)) = legacy_mod_data { + let cfg = ModConfig { + bundled: false, + dir: PathBuf::new(), + id: mod_id.clone(), + name: mod_id, + summary: "A mod for the game Warhammer 40,000: Darktide".into(), + version: "N/A".into(), + description: None, + author: None, + image: None, + categories: Vec::new(), + packages: Vec::new(), + resources, + depends: Vec::new(), + }; + + Ok((cfg, root)) } else { eyre::bail!( "Mod needs a config file or `.mod` file. \ diff --git a/lib/nexusmods/src/lib.rs b/lib/nexusmods/src/lib.rs index 0cca768..06c1f01 100644 --- a/lib/nexusmods/src/lib.rs +++ b/lib/nexusmods/src/lib.rs @@ -117,7 +117,7 @@ impl Api { let Some(file) = files .files .into_iter() - .find(|file| file.updated_timestamp == timestamp) + .find(|file| file.uploaded_timestamp == timestamp) else { let err = Error::Custom("Timestamp does not match any file".into()); return Err(err); diff --git a/lib/nexusmods/src/types.rs b/lib/nexusmods/src/types.rs index b88911e..db0f624 100644 --- a/lib/nexusmods/src/types.rs +++ b/lib/nexusmods/src/types.rs @@ -77,13 +77,13 @@ pub struct File { pub size: u64, pub file_name: String, #[serde(with = "time::serde::timestamp")] - pub updated_timestamp: OffsetDateTime, + pub uploaded_timestamp: OffsetDateTime, pub mod_version: String, pub external_virus_scan_url: String, pub description: String, pub size_kb: u64, pub size_in_bytes: u64, - pub changelog_html: String, + pub changelog_html: Option, pub content_preview_link: String, }