Limit normal search fallback to 404 respnse

Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
(cherry picked from commit 28c42d04b6)
This commit is contained in:
0x189D7997 2026-04-14 23:51:34 +00:00 committed by github-actions[bot]
parent 6b60a243bc
commit f89a1f6378
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) {
if (!s_running_models.constFind(this).value())
return;
m_search_state = SearchState::ResetRequested;;
if (network_error_code == 404) {
m_search_state = SearchState::ResetRequested;
}
searchRequestFailed(reason, network_error_code);
};
callbacks.on_abort = [this] {

View file

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

View file

@ -142,7 +142,9 @@ void ModpackListModel::performPaginatedSearch()
ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks;
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);
};
callbacks.on_succeed = [this](auto& pack) { searchRequestForOneSucceeded(pack); };