mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
Limit normal search fallback to 404 respnse
Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
This commit is contained in:
parent
364968a6b4
commit
28c42d04b6
|
|
@ -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] {
|
||||||
|
|
|
||||||
|
|
@ -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); };
|
||||||
|
|
|
||||||
|
|
@ -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); };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue