Browse Source

Merge pull request #11254 from Chocobo1/autoTMM

Fix seeding failed after creating a new torrent
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
72e511e3c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/gui/torrentcreatordialog.cpp

7
src/gui/torrentcreatordialog.cpp

@ -200,8 +200,8 @@ void TorrentCreatorDialog::handleCreationSuccess(const QString &path, const QStr @@ -200,8 +200,8 @@ void TorrentCreatorDialog::handleCreationSuccess(const QString &path, const QStr
setCursor(QCursor(Qt::ArrowCursor));
if (m_ui->checkStartSeeding->isChecked()) {
// Create save path temp data
BitTorrent::TorrentInfo t = BitTorrent::TorrentInfo::loadFromFile(Utils::Fs::toNativePath(path));
if (!t.isValid()) {
const BitTorrent::TorrentInfo info = BitTorrent::TorrentInfo::loadFromFile(Utils::Fs::toNativePath(path));
if (!info.isValid()) {
QMessageBox::critical(this, tr("Torrent creation failed"), tr("Reason: Created torrent is invalid. It won't be added to download list."));
return;
}
@ -210,8 +210,9 @@ void TorrentCreatorDialog::handleCreationSuccess(const QString &path, const QStr @@ -210,8 +210,9 @@ void TorrentCreatorDialog::handleCreationSuccess(const QString &path, const QStr
params.savePath = branchPath;
params.skipChecking = true;
params.ignoreShareLimits = m_ui->checkIgnoreShareLimits->isChecked();
params.useAutoTMM = TriStateBool::False; // otherwise if it is on by default, it will overwrite `savePath` to the default save path
BitTorrent::Session::instance()->addTorrent(t, params);
BitTorrent::Session::instance()->addTorrent(info, params);
}
QMessageBox::information(this, tr("Torrent creator")
, QString("%1\n%2").arg(tr("Torrent created:"), Utils::Fs::toNativePath(path)));

Loading…
Cancel
Save