mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
Some progress on new RSS download rules (still unused)
This commit is contained in:
parent
41a61ced89
commit
8597689a52
4 changed files with 70 additions and 1 deletions
|
@ -82,6 +82,30 @@ RssDownloadRule RssDownloadRule::fromOldFormat(const QHash<QString, QVariant> &r
|
|||
return rule;
|
||||
}
|
||||
|
||||
RssDownloadRule RssDownloadRule::fromNewFormat(const QHash<QString, QVariant> &rule_hash)
|
||||
{
|
||||
RssDownloadRule rule;
|
||||
rule.setName(rule_hash.value("name").toString());
|
||||
rule.setMustContain(rule_hash.value("must_contain").toString());
|
||||
rule.setMustNotContain(rule_hash.value("must_not_contain").toString());
|
||||
rule.setRssFeeds(rule_hash.value("affected_feeds").toStringList());
|
||||
rule.setEnabled(rule_hash.value("enabled", false).toBool());
|
||||
rule.setLabel(rule_hash.value("label_assigned").toString());
|
||||
return rule;
|
||||
}
|
||||
|
||||
QHash<QString, QVariant> RssDownloadRule::toHash() const
|
||||
{
|
||||
QHash<QString, QVariant> hash;
|
||||
hash["name"] = m_name;
|
||||
hash["must_contain"] = m_mustContain.join(" ");
|
||||
hash["must_not_contain"] = m_mustNotContain.join(" ");
|
||||
hash["affected_feeds"] = m_rssFeeds;
|
||||
hash["enabled"] = m_enabled;
|
||||
hash["label_assigned"] = m_label;
|
||||
return hash;
|
||||
}
|
||||
|
||||
bool RssDownloadRule::operator==(const RssDownloadRule &other) {
|
||||
return m_name == other.name();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue