Return back changes in DownloadManager.

This commit is contained in:
levlam 2022-03-03 19:41:56 +03:00
parent f1cf7bdc3f
commit 1607707ef8
1 changed files with 12 additions and 8 deletions

View File

@ -134,14 +134,6 @@ class DownloadManagerImpl final : public DownloadManager {
return remove_file(file_id, {}, false);
}
Status change_search_text(FileId file_id, FileSourceId file_source_id, string search_text) final {
TRY_STATUS(check_is_active());
TRY_RESULT(file_info_ptr, get_file_info(file_id, file_source_id));
auto &file_info = *file_info_ptr;
hints_.add(file_info.download_id, search_text.empty() ? string(" ") : search_text);
return Status::OK();
}
Status remove_all_files(bool only_active, bool only_completed, bool delete_from_cache) final {
TRY_STATUS(check_is_active());
vector<FileId> to_remove;
@ -182,6 +174,18 @@ class DownloadManagerImpl final : public DownloadManager {
return Status::OK();
}
Status change_search_text(FileId file_id, FileSourceId file_source_id, string search_text) final {
if (!is_search_inited_) {
return Status::OK();
}
TRY_STATUS(check_is_active());
TRY_RESULT(file_info_ptr, get_file_info(file_id, file_source_id));
auto &file_info = *file_info_ptr;
hints_.add(file_info.download_id, search_text.empty() ? string(" ") : search_text);
return Status::OK();
}
void hints_synchronized(Result<Unit>) {
if (G()->close_flag()) {
return;