mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 11:05:08 -05:00
fix(ModSource): fix bad unwrap in fetchValidTags
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions
Check CHANGELOG.md / Check CHANGELOG.md (push) Waiting to run
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions
Check CHANGELOG.md / Check CHANGELOG.md (push) Waiting to run
This commit is contained in:
parent
22a11b96e2
commit
01807fedc9
1 changed files with 11 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <Geode/ui/GeodeUI.hpp>
|
||||
#include <server/DownloadManager.hpp>
|
||||
#include <Geode/binding/GameObject.hpp>
|
||||
#include <unordered_set>
|
||||
|
||||
LoadModSuggestionTask loadModSuggestion(LoadProblem const& problem) {
|
||||
// Recommended / suggested are essentially the same thing for the purposes of this
|
||||
|
@ -183,19 +184,22 @@ server::ServerRequest<std::unordered_set<std::string>> ModSource::fetchValidTags
|
|||
return std::visit(makeVisitor {
|
||||
[](Mod* mod) {
|
||||
return server::getTags().map(
|
||||
[mod](auto* result) -> Result<std::unordered_set<std::string>, server::ServerError> {
|
||||
[mod](Result<std::unordered_set<std::string>, server::ServerError>* result)
|
||||
-> Result<std::unordered_set<std::string>, server::ServerError> {
|
||||
std::unordered_set<std::string> finalTags;
|
||||
auto modTags = mod->getMetadata().getTags();
|
||||
|
||||
if (result->isOk()) {
|
||||
std::unordered_set<std::string> fetched = result->unwrap();
|
||||
// Filter out invalid tags
|
||||
auto modTags = mod->getMetadata().getTags();
|
||||
auto finalTags = std::unordered_set<std::string>();
|
||||
for (auto& tag : modTags) {
|
||||
if (result->unwrap().contains(tag)) {
|
||||
for (std::string const& tag : modTags) {
|
||||
if (fetched.contains(tag)) {
|
||||
finalTags.insert(tag);
|
||||
}
|
||||
}
|
||||
return Ok(finalTags);
|
||||
}
|
||||
return Ok(result->unwrap());
|
||||
|
||||
return Ok(finalTags);
|
||||
},
|
||||
[](server::ServerProgress* progress) {
|
||||
return *progress;
|
||||
|
|
Loading…
Reference in a new issue