mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
Fix rss download rule import from qBittorrent < v2.5.0
This commit is contained in:
parent
d7b0299416
commit
5a02c56865
4 changed files with 42 additions and 19 deletions
|
@ -29,6 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QDebug>
|
||||
|
||||
#include "rssdownloadrule.h"
|
||||
#include "preferences.h"
|
||||
|
@ -69,16 +70,18 @@ void RssDownloadRule::setMustNotContain(const QString &tokens)
|
|||
|
||||
RssDownloadRule RssDownloadRule::fromOldFormat(const QVariantHash &rule_hash, const QString &feed_url, const QString &rule_name)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << feed_url << rule_name;
|
||||
RssDownloadRule rule;
|
||||
rule.setName(rule_name);
|
||||
rule.setMustContain(rule_hash.value("matches", "").toString());
|
||||
rule.setMustNotContain(rule_hash.value("not", "").toString());
|
||||
rule.setRssFeeds(QStringList() << feed_url);
|
||||
if(!feed_url.isEmpty())
|
||||
rule.setRssFeeds(QStringList() << feed_url);
|
||||
rule.setSavePath(rule_hash.value("save_path", "").toString());
|
||||
// Is enabled?
|
||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||
const QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", true).toHash();
|
||||
rule.setEnabled(feeds_w_downloader.value(feed_url, false).toBool());
|
||||
const QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on").toHash();
|
||||
rule.setEnabled(feeds_w_downloader.value(feed_url, true).toBool());
|
||||
// label was unsupported < 2.5.0
|
||||
return rule;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue