Ticket #1510: rtorrent.finished[1].patch
| File rtorrent.finished[1].patch, 1.2 KB (added by dbrobins (AT) i4031.net, 3 years ago) |
|---|
-
src/core/download_list.cc
old new 563 563 // up/downloaded baseline. 564 564 download->download()->tracker_list()->send_completed(); 565 565 566 // save the hash in case the event deletes the object (e.g. d.erase) 567 torrent::HashString infohash = download->download()->info_hash(); 568 566 569 rpc::commands.call_catch("event.download.finished", rpc::make_target(download), torrent::Object(), "Download event action failed: "); 567 570 568 571 if (download->resume_flags() != ~uint32_t()) 569 572 throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t()."); 570 573 571 if (!download->is_active() && rpc::call_command_value("d.get_state", rpc::make_target(download)) == 1) 572 resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | torrent::Download::start_keep_baseline); 574 if (find(infohash) != end()) { 575 if (!download->is_active() && rpc::call_command_value("d.get_state", rpc::make_target(download)) == 1) 576 resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | torrent::Download::start_keep_baseline); 577 } 573 578 } 574 579 575 580 }
