From c580e59ceabcd3d8a5c367ac0ceb32dd73fdce6b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 21 Feb 2025 08:57:06 -0600 Subject: [PATCH] fix --- monitarr/libmonitarr/src/actions.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitarr/libmonitarr/src/actions.cpp b/monitarr/libmonitarr/src/actions.cpp index ffce0c5..1b001b4 100644 --- a/monitarr/libmonitarr/src/actions.cpp +++ b/monitarr/libmonitarr/src/actions.cpp @@ -73,15 +73,12 @@ auto get_download(std::uint64_t record_id, const server_cfg &server, utils::error::handle_error( function_name, fmt::format("get download request failed|{}|{}|{}", server.id, server.url, response->status)); - if (is_not_found != nullptr) { - *is_not_found = response->status == httplib::StatusCode::NotFound_404; - } return std::nullopt; } auto json_data = nlohmann::json::parse(response->body); if (json_data.at("page").get() != page) { - return std::nullopt; + break; } auto iter = std::ranges::find_if( @@ -96,6 +93,10 @@ auto get_download(std::uint64_t record_id, const server_cfg &server, return *iter; } + if (is_not_found != nullptr) { + *is_not_found = true; + } + return std::nullopt; }