Merge pull request #8945 from glassez/rss-rule

Improve code of  RSS auto-downloading rule. Closes #8933
This commit is contained in:
Vladimir Golovnev
2018-05-21 08:04:12 +03:00
committed by GitHub
5 changed files with 174 additions and 189 deletions

View File

@@ -114,6 +114,8 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
connect(m_ui->checkRegex, &QCheckBox::stateChanged, this, &AutomatedRssDownloader::updateMustLineValidity);
connect(m_ui->checkRegex, &QCheckBox::stateChanged, this, &AutomatedRssDownloader::updateMustNotLineValidity);
connect(m_ui->checkSmart, &QCheckBox::stateChanged, this, &AutomatedRssDownloader::handleRuleDefinitionChanged);
connect(m_ui->spinIgnorePeriod, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
, this, &AutomatedRssDownloader::handleRuleDefinitionChanged);
connect(m_ui->listFeeds, &QListWidget::itemChanged, this, &AutomatedRssDownloader::handleFeedCheckStateChange);
@@ -581,7 +583,7 @@ void AutomatedRssDownloader::updateMatchingArticles()
QStringList matchingArticles;
foreach (auto article, feed->articles())
if (rule.matches(article->title()))
if (rule.matches(article->data()))
matchingArticles << article->title();
if (!matchingArticles.isEmpty())
addFeedArticlesToTree(feed, matchingArticles);

View File

@@ -106,17 +106,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkSmart">
<property name="toolTip">
<string>Smart Episode Filter will check the episode number to prevent downloading of duplicates.
Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also support - as a separator)</string>
</property>
<property name="text">
<string>Use Smart Episode Filter</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
@@ -191,6 +180,17 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkSmart">
<property name="toolTip">
<string>Smart Episode Filter will check the episode number to prevent downloading of duplicates.
Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also support - as a separator)</string>
</property>
<property name="text">
<string>Use Smart Episode Filter</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">