TorrentFlags

The torrent_flags_t bit constants. This is a pure-Kotlin port of libtorrent's torrent_flags namespace (include/libtorrent/torrent_flags.hpp).

In libtorrent these are bitfield_flag<std::uint64_t> values (0_bit, 1_bit, …). KiteTorrent carries the same 64-bit mask as a plain Long; each constant is 1L shl bit for the same bit index libtorrent assigns, so a flag word is byte-for-byte the same value as in C++.

Only the flags that survive into / out of fast-resume are exercised by io.github.yuroyami.kitetorrent.torrent.resume.ResumeData, but the full set is reproduced for fidelity and so callers can configure an AddTorrentParams exactly as they would the C++ struct. The deprecated TORRENT_ABI_VERSION == 1 flags (pinned, override_resume_data, merge_resume_trackers, use_resume_save_path, merge_resume_http_seeds) are intentionally omitted: this port targets the non-deprecated build, matching io.github.yuroyami.kitetorrent.error.LibtorrentError's TORRENT_ABI_VERSION != 1 choice, and defaultFlags correspondingly excludes them.

Properties

Link copied to clipboard

Subject this torrent to the session IP filter (3_bit). On by default.

Link copied to clipboard
const val AUTO_MANAGED: Long

Let libtorrent's queuing logic start/stop/seed this torrent automatically (5_bit).

Link copied to clipboard

Default any file not covered by file_priorities to dont_download (23_bit).

Link copied to clipboard
const val DEFAULT_FLAGS: Long

The flags an add_torrent_params is constructed with. This is the port of torrent_flags::default_flags for TORRENT_ABI_VERSION != 1: update_subscribe | auto_managed | paused | apply_ip_filter | need_save_resume.

Link copied to clipboard
const val DISABLE_DHT: Long

Disable DHT for this torrent only (19_bit).

Link copied to clipboard
const val DISABLE_LSD: Long

Disable local service discovery for this torrent only (20_bit).

Link copied to clipboard
const val DISABLE_PEX: Long

Disable peer exchange for this torrent only (21_bit).

Link copied to clipboard

It's an error to add a torrent already in the session (6_bit). Add-time only; not saved by write_resume_data.

Link copied to clipboard
const val I2P_TORRENT: Long

Treat as an i2p torrent for the allow_i2p_mixed setting (24_bit).

Link copied to clipboard

The torrent needs to (re-)save its resume data (13_bit). On by default; this is an ephemeral running-torrent state and is cleared by read_resume_data; not saved.

Link copied to clipboard

Trust the resume data without re-checking files on disk (22_bit).

Link copied to clipboard

Trackers in AddTorrentParams override those in the .torrent (11_bit). Set by read_resume_data when the resume data carries a trackers list; not saved.

Link copied to clipboard

Web seeds in AddTorrentParams override those in the .torrent (12_bit). Set by read_resume_data when the resume data carries web seeds; not saved.

Link copied to clipboard
const val PAUSED: Long

The torrent is paused: it won't contact the tracker or any peers (4_bit).

Link copied to clipboard
const val SEED_MODE: Long

Assume all files are present and valid; verify lazily on first request (0_bit).

Link copied to clipboard

Pick low-index pieces before high-index ones (9_bit).

Link copied to clipboard
const val SHARE_MODE: Long

Share-mode: only upload, never download more than uploaded (2_bit).

Link copied to clipboard

Force-stop on the edge from non-transferring to transferring state (10_bit).

Link copied to clipboard
const val SUPER_SEEDING: Long

Super-seeding / initial-seeding mode (8_bit).

Link copied to clipboard

Include this torrent in post_torrent_updates() (7_bit). On by default; not saved.

Link copied to clipboard
const val UPLOAD_MODE: Long

Start in upload-only mode: make no piece requests (1_bit).

Functions

Link copied to clipboard
fun has(flags: Long, flag: Long): Boolean

True if flag (a single-bit mask) is set in flags.