Move basic search-related code into Core.

Also use qBittorrent torrent file download routines instead of
nova2dl.py script.
This commit is contained in:
Vladimir Golovnev (Glassez) 2015-08-27 14:25:14 +03:00 committed by Vladimir Golovnev (qlassez)
parent 8754fd5646
commit 54979e6b53
22 changed files with 1379 additions and 1235 deletions

View file

@ -968,6 +968,10 @@ bool Session::addTorrent(QString source, const AddTorrentParams &params)
qDebug("Converting bc link to magnet link");
source = Utils::Misc::bcLinkToMagnet(source);
}
else if (((source.size() == 40) && !source.contains(QRegExp("[^0-9A-Fa-f]")))
|| ((source.size() == 32) && !source.contains(QRegExp("[^2-7A-Za-z]")))) {
source = "magnet:?xt=urn:btih:" + source;
}
if (Utils::Misc::isUrl(source)) {
Logger::instance()->addMessage(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(source));