Merge pull request #17713 from Chocobo1/trackers

Revise 'Add trackers' dialog
This commit is contained in:
Chocobo1
2022-09-16 12:06:22 +08:00
committed by GitHub
15 changed files with 276 additions and 130 deletions

View File

@@ -745,14 +745,8 @@ void TorrentsController::addTrackersAction()
if (!torrent)
throw APIError(APIErrorType::NotFound);
QVector<BitTorrent::TrackerEntry> trackers;
for (const QString &urlStr : asConst(params()[u"urls"_qs].split(u'\n')))
{
const QUrl url {urlStr.trimmed()};
if (url.isValid())
trackers.append({url.toString()});
}
torrent->addTrackers(trackers);
const QVector<BitTorrent::TrackerEntry> entries = BitTorrent::parseTrackerEntries(params()[u"urls"_qs]);
torrent->addTrackers(entries);
}
void TorrentsController::editTrackerAction()