diff --git a/src/base/rss/rssdownloadrule.cpp b/src/base/rss/rssdownloadrule.cpp index 0bc455263..be1eb0d3f 100644 --- a/src/base/rss/rssdownloadrule.cpp +++ b/src/base/rss/rssdownloadrule.cpp @@ -153,6 +153,7 @@ bool DownloadRule::matches(const QString &articleTitle) const QString s = f.cap(1); QStringList eps = f.cap(2).split(";"); + int sOurs = s.toInt(); foreach (const QString &epStr, eps) { if (epStr.isEmpty()) @@ -165,8 +166,8 @@ bool DownloadRule::matches(const QString &articleTitle) const ep = ep.right(ep.size() - 1); if (ep.indexOf('-') != -1) { // Range detected - QString partialPattern1 = "\\bs0?" + s + "[ -_\\.]?" + "e(0?\\d{1,4})(?:\\D|\\b)"; - QString partialPattern2 = "\\b" + s + "x" + "(0?\\d{1,4})(?:\\D|\\b)"; + QString partialPattern1 = "\\bs0?(\\d{1,4})[ -_\\.]?e(0?\\d{1,4})(?:\\D|\\b)"; + QString partialPattern2 = "\\b(\\d{1,4})x(0?\\d{1,4})(?:\\D|\\b)"; QRegExp reg(partialPattern1, Qt::CaseInsensitive); if (ep.endsWith('-')) { // Infinite range @@ -181,8 +182,9 @@ bool DownloadRule::matches(const QString &articleTitle) const } if (pos != -1) { - int epTheirs = reg.cap(1).toInt(); - if (epTheirs >= epOurs) { + int sTheirs = reg.cap(1).toInt(); + int epTheirs = reg.cap(2).toInt(); + if (((sTheirs == sOurs) && (epTheirs >= epOurs)) || (sTheirs > sOurs)) { qDebug() << "Matched episode:" << ep; qDebug() << "Matched article:" << articleTitle; return true; @@ -207,8 +209,9 @@ bool DownloadRule::matches(const QString &articleTitle) const } if (pos != -1) { - int epTheirs = reg.cap(1).toInt(); - if ((epOursFirst <= epTheirs) && (epOursLast >= epTheirs)) { + int sTheirs = reg.cap(1).toInt(); + int epTheirs = reg.cap(2).toInt(); + if ((sTheirs == sOurs) && ((epOursFirst <= epTheirs) && (epOursLast >= epTheirs))) { qDebug() << "Matched episode:" << ep; qDebug() << "Matched article:" << articleTitle; return true; diff --git a/src/gui/rss/automatedrssdownloader.cpp b/src/gui/rss/automatedrssdownloader.cpp index 7d2d55113..80e13466b 100644 --- a/src/gui/rss/automatedrssdownloader.cpp +++ b/src/gui/rss/automatedrssdownloader.cpp @@ -81,7 +81,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(const QWeakPointer + "
  • " + tr("Three range types for episodes are supported: ") + "
  • " + "
  • "; + + "
  • " + tr("Infinite range: 1x25-; matches episodes 25 and upward of season one, and all episodes of later seasons") + "
  • " + ""; ui->lineEFilter->setToolTip(tip); initCategoryCombobox(); loadFeedList();