added logging

This commit is contained in:
Scott E. Graves 2025-02-20 07:03:34 -06:00
parent e56927eeb3
commit 6d1da0a9da

View File

@ -200,28 +200,34 @@ void remove_stalled(std::string_view download_id, std::string_view title,
std::optional<nlohmann::json> data;
std::uint64_t search_id{};
if (utils::string::contains("radarr", server.id)) {
data = nlohmann::json({
{"name", "MoviesSearch"},
{"movieIds", {movie_id}},
});
search_id = movie_id;
} else if (utils::string::contains("sonarr", server.id)) {
data = nlohmann::json({
{"name", "EpisodeSearch"},
{"episodeIds", {episode_id}},
});
search_id = episode_id;
}
if (not data.has_value()) {
return;
}
utils::error::handle_info(
function_name, fmt::format("searching release {}|{}|{}|{}|{}", server.id,
server.url, title, download_id, search_id));
response = cli.Post(fmt::format("/api/{}/command", server.api_version),
data->dump(), "application/json");
if (not response) {
utils::error::handle_error(
function_name, fmt::format("failed to search|{}|{}|{}|{}|no response",
server.id, server.url, title, movie_id));
server.id, server.url, title, search_id));
return;
}
@ -231,7 +237,7 @@ void remove_stalled(std::string_view download_id, std::string_view title,
utils::error::handle_error(function_name,
fmt::format("failed to search|{}|{}|{}|{}|{}",
server.id, server.url, title, movie_id,
response->status));
server.id, server.url, title,
search_id, response->status));
}
} // namespace monitarr