Fix for running extractor without optional game flag (#3896)

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
tripp
2025-04-13 00:42:50 -04:00
committed by GitHub
parent 647282d896
commit a1d1ff139b
+7 -1
View File
@@ -92,7 +92,8 @@ std::tuple<std::optional<ISOMetadata>, ExtractorErrorCode> validate(
}
lg::error("Overall ISO content's hash does not match. Expected '{}', Actual '{}'", all_expected,
expected_hash);
return {std::nullopt, ExtractorErrorCode::VALIDATION_FILE_CONTENTS_UNEXPECTED};
return {std::make_optional(version_info),
ExtractorErrorCode::VALIDATION_FILE_CONTENTS_UNEXPECTED};
}
return {
@@ -302,6 +303,7 @@ int main(int argc, char** argv) {
// We know the version since we just extracted it, so the user didn't need to provide this
// explicitly
data_subfolder = data_subfolders.at(version_info->game_name);
game_name = version_info->game_name;
if (!extraction_path.empty()) {
iso_data_path = extraction_path / data_subfolder;
} else {
@@ -337,6 +339,10 @@ int main(int argc, char** argv) {
(flag_fail_on_validation && validate_code != ExtractorErrorCode::SUCCESS)) {
return static_cast<int>(validate_code);
}
if (version_info) {
data_subfolder = data_subfolders.at(version_info->game_name);
game_name = version_info->game_name;
}
}
// write out a json file with some metadata for the game