Metadata for a single torrent search result.
More...
#include <torrentsearchresult.h>
|
| QString | name () const |
| | Torrent display name.
|
| |
| QString | infoHash () const |
| | Hex-encoded info hash string.
|
| |
| qint64 | size () const |
| | Total content size in bytes.
|
| |
| int | seeders () const |
| | Number of seeders reported by the tracker.
|
| |
| int | leechers () const |
| | Number of leechers reported by the tracker.
|
| |
| QDateTime | addedDate () const |
| | Date/time the torrent was added to the index.
|
| |
| QString | category () const |
| | Category string (e.g.
|
| |
| QString | uploaderName () const |
| | Name of the uploader.
|
| |
| MagnetLink | toMagnetLink () const |
| | Convert this result to a MagnetLink.
|
| |
|
| static TorrentSearchResult | fromJson (const QJsonObject &json) |
| | Parse a search result from a JSON object.
|
| |
| static QString | formatSize (qint64 bytes) |
| | Format a byte count as a human-readable string.
|
| |
Metadata for a single torrent search result.
Populated by TorrentSearcher from API responses. Use toMagnetLink() to convert a result into a MagnetLink suitable for TorrentClient::addTorrent().
Definition at line 16 of file torrentsearchresult.h.
◆ addedDate()
| QDateTime TorrentSearchResult::addedDate |
( |
| ) |
const |
|
inline |
◆ category()
| QString TorrentSearchResult::category |
( |
| ) |
const |
|
inline |
◆ formatSize()
| static QString TorrentSearchResult::formatSize |
( |
qint64 |
bytes | ) |
|
|
static |
Format a byte count as a human-readable string.
- Parameters
-
- Returns
- Formatted string (e.g. "1.23 GB").
◆ fromJson()
Parse a search result from a JSON object.
Expected fields: name, info_hash, size, seeders, leechers, added, category, username.
- Parameters
-
| json | The JSON object to parse. |
- Returns
- A populated TorrentSearchResult.
◆ infoHash()
| QString TorrentSearchResult::infoHash |
( |
| ) |
const |
|
inline |
◆ leechers()
| int TorrentSearchResult::leechers |
( |
| ) |
const |
|
inline |
◆ name()
| QString TorrentSearchResult::name |
( |
| ) |
const |
|
inline |
◆ seeders()
| int TorrentSearchResult::seeders |
( |
| ) |
const |
|
inline |
◆ size()
| qint64 TorrentSearchResult::size |
( |
| ) |
const |
|
inline |
◆ toMagnetLink()
| MagnetLink TorrentSearchResult::toMagnetLink |
( |
| ) |
const |
◆ uploaderName()
| QString TorrentSearchResult::uploaderName |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: