Browse Source

Merge pull request #2207 from pmzqla/rss-rules

Fix RSS "OR" condition in "must not contain" rules.
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
f61675d98a
  1. 2
      src/rss/automatedrssdownloader.cpp
  2. 4
      src/rss/rssdownloadrule.cpp
  3. 2
      src/rss/rssdownloadrule.h

2
src/rss/automatedrssdownloader.cpp

@ -605,7 +605,7 @@ void AutomatedRssDownloader::updateMustNotLineValidity() @@ -605,7 +605,7 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
if (ui->checkRegex->isChecked())
tokens << text;
else
tokens << text.split(QRegExp("[\\s|]"));
tokens << text.split("|");
foreach (const QString &token, tokens) {
QRegExp reg(token, Qt::CaseInsensitive, ui->checkRegex->isChecked() ? QRegExp::RegExp : QRegExp::Wildcard);
if (!reg.isValid()) {

4
src/rss/rssdownloadrule.cpp

@ -133,7 +133,7 @@ void RssDownloadRule::setMustNotContain(const QString &tokens) @@ -133,7 +133,7 @@ void RssDownloadRule::setMustNotContain(const QString &tokens)
if (m_useRegex)
m_mustNotContain = QStringList() << tokens;
else
m_mustNotContain = tokens.split(QRegExp("[\\s|]"));
m_mustNotContain = tokens.split("|");
}
RssDownloadRulePtr RssDownloadRule::fromVariantHash(const QVariantHash &rule_hash)
@ -156,7 +156,7 @@ QVariantHash RssDownloadRule::toVariantHash() const @@ -156,7 +156,7 @@ QVariantHash RssDownloadRule::toVariantHash() const
QVariantHash hash;
hash["name"] = m_name;
hash["must_contain"] = m_mustContain.join(" ");
hash["must_not_contain"] = m_mustNotContain.join(" ");
hash["must_not_contain"] = m_mustNotContain.join("|");
hash["save_path"] = m_savePath;
hash["affected_feeds"] = m_rssFeeds;
hash["enabled"] = m_enabled;

2
src/rss/rssdownloadrule.h

@ -62,7 +62,7 @@ public: @@ -62,7 +62,7 @@ public:
inline bool isEnabled() const { return m_enabled; }
inline void setEnabled(bool enable) { m_enabled = enable; }
inline QString mustContain() const { return m_mustContain.join(" "); }
inline QString mustNotContain() const { return m_mustNotContain.join(" "); }
inline QString mustNotContain() const { return m_mustNotContain.join("|"); }
inline bool useRegex() const { return m_useRegex; }
inline void setUseRegex(bool enabled) { m_useRegex = enabled; }
inline QString episodeFilter() const { return m_episodeFilter; }

Loading…
Cancel
Save