check status
This commit is contained in:
parent
6c4fcf1e2d
commit
855e3853b6
@ -111,6 +111,8 @@ static void check_server(const server_cfg &server, data_db &state_db) {
|
||||
: std::uint64_t{0U};
|
||||
auto size_left = record.at("sizeleft").get<std::uint64_t>();
|
||||
auto title = record.at("title").get<std::string>();
|
||||
auto is_downloading = utils::string::contains(
|
||||
record.at("status").get<std::string>(), "downloading");
|
||||
|
||||
auto data = state_db.get(download_id);
|
||||
const auto update_entry = [&download_id, &now, &size_left, &state_db,
|
||||
@ -135,13 +137,15 @@ static void check_server(const server_cfg &server, data_db &state_db) {
|
||||
if (size_left == data->size_left) {
|
||||
remove_stalled(download_id, title, episode_id, movie_id, server,
|
||||
state_db);
|
||||
} else if (not is_downloading) {
|
||||
state_db.remove(download_id);
|
||||
} else {
|
||||
update_entry();
|
||||
}
|
||||
} else if (size_left == 0U) {
|
||||
} else if (size_left == 0U || not is_downloading) {
|
||||
state_db.remove(download_id);
|
||||
}
|
||||
} else {
|
||||
} else if (is_downloading) {
|
||||
update_entry();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user