Limit normal search fallback to 404 respnse

Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
This commit is contained in:
0x189D7997 2026-04-14 23:51:34 +00:00 committed by GitHub
parent 364968a6b4
commit 28c42d04b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View file

@ -147,7 +147,9 @@ void ResourceModel::search()
callbacks.on_fail = [this](QString reason, int network_error_code) { callbacks.on_fail = [this](QString reason, int network_error_code) {
if (!s_running_models.constFind(this).value()) if (!s_running_models.constFind(this).value())
return; return;
m_search_state = SearchState::ResetRequested;; if (network_error_code == 404) {
m_search_state = SearchState::ResetRequested;
}
searchRequestFailed(reason, network_error_code); searchRequestFailed(reason, network_error_code);
}; };
callbacks.on_abort = [this] { callbacks.on_abort = [this] {

View file

@ -173,8 +173,10 @@ void ListModel::performPaginatedSearch()
if (!projectId.isEmpty()) { if (!projectId.isEmpty()) {
ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks; ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks;
callbacks.on_fail = [this](QString reason, int) { callbacks.on_fail = [this](QString reason, int network_error_code) {
m_searchState = ResetRequested; if (network_error_code == 404) {
m_searchState = ResetRequested;
}
searchRequestFailed(reason); searchRequestFailed(reason);
}; };
callbacks.on_succeed = [this](auto& pack) { searchRequestForOneSucceeded(pack); }; callbacks.on_succeed = [this](auto& pack) { searchRequestForOneSucceeded(pack); };

View file

@ -142,7 +142,9 @@ void ModpackListModel::performPaginatedSearch()
ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks; ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks;
callbacks.on_fail = [this](QString reason, int network_error_code) { callbacks.on_fail = [this](QString reason, int network_error_code) {
m_searchState = ResetRequested; if (network_error_code == 404) {
m_searchState = ResetRequested;
}
searchRequestFailed(reason, network_error_code); searchRequestFailed(reason, network_error_code);
}; };
callbacks.on_succeed = [this](auto& pack) { searchRequestForOneSucceeded(pack); }; callbacks.on_succeed = [this](auto& pack) { searchRequestForOneSucceeded(pack); };