Add source field in Torrent creator. Closes #7965.

This field is often used for cross-seeding between (private) trackers.
This commit is contained in:
Chocobo1
2017-12-05 21:18:18 +08:00
parent c405cb2f1c
commit 8dcf326576
5 changed files with 27 additions and 2 deletions

View File

@@ -124,6 +124,14 @@ void TorrentCreatorThread::run()
if (isInterruptionRequested()) return;
libt::entry entry = newTorrent.generate();
// add source field
if (!m_params.source.isEmpty())
entry["info"]["source"] = m_params.source.toStdString();
if (isInterruptionRequested()) return;
// create the torrent
std::ofstream outfile(
#ifdef _MSC_VER
@@ -137,7 +145,7 @@ void TorrentCreatorThread::run()
if (isInterruptionRequested()) return;
libt::bencode(std::ostream_iterator<char>(outfile), newTorrent.generate());
libt::bencode(std::ostream_iterator<char>(outfile), entry);
outfile.close();
emit updateProgress(100);

View File

@@ -43,6 +43,7 @@ namespace BitTorrent
QString inputPath;
QString savePath;
QString comment;
QString source;
QStringList trackers;
QStringList urlSeeds;
};