1#ifndef TORRENTCREATOR_H
2#define TORRENTCREATOR_H
4#include <Kanoop/torrent/kanooptorrent.h>
5#include <Kanoop/utility/loggingbaseclass.h>
33 public LoggingBaseClass
67 QStringList
trackers()
const {
return _trackers; }
84 QStringList
webSeeds()
const {
return _webSeeds; }
92 QString
comment()
const {
return _comment; }
127 bool create(
const QString& sourcePath,
const QString& outputPath);
150 QStringList _trackers;
151 QList<QStringList> _trackerTiers;
152 QStringList _webSeeds;
154 QString _creator =
"KanoopTorrentQt";
155 bool _private =
false;
158 qint64 _totalSize = 0;
161 QString _errorString;
Creates .torrent metainfo files from local content.
int pieceCount() const
Number of pieces in the torrent.
QString comment() const
Current comment.
int pieceSize() const
Current piece size setting.
void setPrivate(bool enabled)
Mark the torrent as private (BEP 27).
void progressUpdated(int piecesHashed, int totalPieces)
Emitted during piece hashing to report progress.
bool create(const QString &sourcePath, const QString &outputPath)
Create a .torrent file from local content.
void setComment(const QString &value)
Set the comment embedded in the torrent metainfo.
bool isPrivate() const
Whether the torrent will be marked private.
int fileCount() const
Number of files in the torrent.
void setCreator(const QString &value)
Set the creator string embedded in the torrent metainfo.
QString creator() const
Current creator string.
void setTrackers(const QStringList &urls)
Set tracker announce URLs.
TorrentCreator(QObject *parent=nullptr)
Construct a TorrentCreator.
void setWebSeeds(const QStringList &urls)
Set web seed URLs (BEP 19 / GetRight-style HTTP seeding).
void setPieceSize(int bytes)
Set the piece size in bytes.
QStringList trackers() const
Current tracker list.
QStringList webSeeds() const
Current web seed list.
void addTrackerTier(const QStringList &urls)
Add a tracker tier (group of announce URLs).
QString errorString() const
Last error message, or empty if no error.
qint64 totalSize() const
Total content size in bytes.