Revise 'Add trackers' dialog

* Now it allow user to add tracker to different tier.
* The downloaded trackers are now displayed as is (without modifying).
* Now the dialog remember dialog size and last used URL.

Closes #17692.
This commit is contained in:
Chocobo1
2022-09-12 23:29:09 +08:00
parent 4e326229da
commit e692a191ed
12 changed files with 271 additions and 125 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()