AddTorrentAlert

data class AddTorrentAlert(val torrentName: String?, val errorMessage: String? = null, val errorCategory: String = "libtorrent") : TorrentAlert

Posted every time a torrent is successfully added (or fails to be added), carrying the result of the add operation. Ported from libtorrent::add_torrent_alert (alert_type 67).

libtorrent renders "added torrent: <name>" on success, or "failed to add torrent \"<name>\": [<category>] <error>" on failure.

Constructors

Link copied to clipboard
constructor(torrentName: String?, errorMessage: String? = null, errorCategory: String = "libtorrent")

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val category: Int

The bitmask of AlertCategory flags this alert belongs to. Mirrors alert::category(), which returns the concrete alert's static_category.

Link copied to clipboard

the error category name (e.g. "libtorrent"), for the failure text.

Link copied to clipboard

the error description, or null/empty on success.

Link copied to clipboard
open override val torrentName: String?

the torrent name (falls back to the info-hash hex in C++).

Link copied to clipboard
open override val type: Int

An integer unique to this alert type, matching the C++ alert_type static constant. It can be compared against a concrete alert's ALERT_TYPE to determine the runtime type. Mirrors alert::type().

Link copied to clipboard
open override val what: String

A short string literal naming the alert type (e.g. "torrent_finished"). It carries no bundled information. Mirrors alert::what(), which in libtorrent returns alert_name(alert_type).

Functions

Link copied to clipboard
open override fun message(): String

A string describing the alert and the information bundled with it. Intended for debugging/development, not localization. Mirrors alert::message().