Compare commits
2 commits
440d0f505b
...
a0fe5d3f81
Author | SHA1 | Date | |
---|---|---|---|
a0fe5d3f81 | |||
2ad3fd0fc1 |
3 changed files with 23 additions and 3 deletions
|
@ -234,6 +234,8 @@ fn extract_mod_config<R: Read + Seek>(archive: &mut ZipArchive<R>) -> 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<R: Read + Seek>(archive: &mut ZipArchive<R>) -> 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. \
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<String>,
|
||||
pub content_preview_link: String,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue