feat: allow trying to use multiple hash types
This commit is contained in:
parent
5c5699bba5
commit
59d628208b
5 changed files with 68 additions and 19 deletions
|
@ -64,8 +64,14 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
|
|||
|
||||
auto hash_list = Json::ensureArray(obj, "hashes");
|
||||
if(!hash_list.isEmpty()){
|
||||
if(hash_list.contains(ProviderCaps.hashType(ModPlatform::Provider::FLAME)))
|
||||
file.hash = Json::requireString(hash_list, "value");
|
||||
auto hash_types = ProviderCaps.hashType(ModPlatform::Provider::FLAME);
|
||||
for(auto& hash_type : hash_types) {
|
||||
if(hash_list.contains(hash_type)) {
|
||||
file.hash = Json::requireString(hash_list, "value");
|
||||
file.hash_type = hash_type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsortedVersions.append(file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue