Skip to content

Commit c636ad4

Browse files
authored
Merge pull request #109 from atenfyr/main
unreal_mod_manager: allow loading mods with unknown DownloadMode
2 parents a2a39b8 + 8bd7972 commit c636ad4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

unreal_mod_manager/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ impl ModLoaderApp {
445445
.show_ui(ui, |ui| {
446446
// for when there is an Index file show force latest version, this to diecrtly indicate that there
447447
// is the possibility of an auto update vie an index file.
448-
if game_mod.download.is_some() {
448+
if game_mod.download.is_some() && game_mod.download.as_ref().unwrap().download_mode == unreal_mod_metadata::DownloadMode::IndexFile {
449449
let latest_version = game_mod.latest_version.clone().unwrap();
450450
ui.selectable_value(
451451
&mut game_mod.selected_version,

unreal_mod_manager/src/mod_processing/index_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub(crate) fn gather_index_files(
9191

9292
data.game_mods
9393
.iter()
94-
.filter(|(mod_id, _)| filter.contains(mod_id))
94+
.filter(|(mod_id, game_mod)| filter.contains(mod_id) && game_mod.download.is_some() && game_mod.download.as_ref().unwrap().download_mode == unreal_mod_metadata::DownloadMode::IndexFile)
9595
.filter_map(|(mod_id, game_mod)| {
9696
game_mod
9797
.download

unreal_mod_metadata/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ impl std::fmt::Display for SyncMode {
5151
pub enum DownloadMode {
5252
#[serde(rename = "index_file")]
5353
IndexFile,
54+
#[serde(other)]
55+
Unknown,
5456
}
5557

5658
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
5759
pub struct DownloadInfo {
5860
#[serde(rename = "type")]
5961
pub download_mode: DownloadMode,
62+
#[serde(default)]
6063
pub url: String,
6164
}
6265

0 commit comments

Comments
 (0)