forked from premiere/premiere-libtorrent
added info_hash to torrent_deleted_alert
This commit is contained in:
parent
a046850130
commit
2b86528e50
|
@ -96,6 +96,7 @@
|
|||
* improved fallocate support
|
||||
* fixed magnet link issue when using resume data
|
||||
* support disk I/O priority settings
|
||||
* added info_hash to torrent_deleted_alert
|
||||
|
||||
release 0.14.9
|
||||
|
||||
|
|
|
@ -173,7 +173,9 @@ void bind_alert()
|
|||
|
||||
class_<torrent_deleted_alert, bases<torrent_alert>, noncopyable>(
|
||||
"torrent_deleted_alert", no_init
|
||||
);
|
||||
)
|
||||
.def_readonly("info_hash", &torrent_deleted_alert::info_hash)
|
||||
;
|
||||
|
||||
class_<torrent_paused_alert, bases<torrent_alert>, noncopyable>(
|
||||
"torrent_paused_alert", no_init
|
||||
|
|
|
@ -483,7 +483,8 @@ the tracker that we've stopped participating in the swarm. The optional second a
|
|||
``options`` can be used to delete all the files downloaded by this torrent. To do this, pass
|
||||
in the value ``session::delete_files``. The removal of the torrent is asyncronous, there is
|
||||
no guarantee that adding the same torrent immediately after it was removed will not throw
|
||||
a libtorrent_exception_ exception.
|
||||
a libtorrent_exception_ exception. Once the torrent is deleted, a torrent_deleted_alert_
|
||||
is posted.
|
||||
|
||||
find_torrent() get_torrents()
|
||||
-----------------------------
|
||||
|
@ -5547,6 +5548,27 @@ The ``error_code`` tells you why it failed.
|
|||
error_code error;
|
||||
};
|
||||
|
||||
torrent_deleted_alert
|
||||
---------------------
|
||||
|
||||
This alert is generated when a request to delete the files of a torrent complete.
|
||||
|
||||
The ``info_hash`` is the info-hash of the torrent that was just deleted. Most of
|
||||
the time the torrent_handle in the torrent_alert_ will be invalid by the time
|
||||
this alert arrives, since the torrent is being deleted. The ``info_hash`` member
|
||||
is hence the main way of identifying which torrent just completed the delete.
|
||||
|
||||
This alert is posted in the ``storage_notification`` category, and that bit
|
||||
needs to be set in the alert mask.
|
||||
|
||||
::
|
||||
|
||||
struct torrent_deleted_alert: torrent_alert
|
||||
{
|
||||
// ...
|
||||
sha1_hash info_hash;
|
||||
};
|
||||
|
||||
torrent_finished_alert
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -669,13 +669,15 @@ namespace libtorrent
|
|||
{
|
||||
torrent_deleted_alert(torrent_handle const& h)
|
||||
: torrent_alert(h)
|
||||
{}
|
||||
{ info_hash = h.info_hash(); }
|
||||
|
||||
TORRENT_DEFINE_ALERT(torrent_deleted_alert);
|
||||
|
||||
const static int static_category = alert::storage_notification;
|
||||
virtual std::string message() const
|
||||
{ return torrent_alert::message() + " deleted"; }
|
||||
|
||||
sha1_hash info_hash;
|
||||
};
|
||||
|
||||
struct TORRENT_EXPORT torrent_delete_failed_alert: torrent_alert
|
||||
|
|
Loading…
Reference in New Issue