From d6cf2fae512b86e296924a8ec0bc745f42f3872d Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 4 Dec 2016 00:17:33 +0100 Subject: [PATCH 1/3] Fix tV processing --- Changelog | 2 ++ nntmux/processing/tv/TV.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 058962b49..f7ee23ecb 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2016-12-04 DariusIII + * Fix: TV processing 2016-12-02 DariusIII * Fix: Undefined notices in admin regexes pages 2016-11-30 DariusIII diff --git a/nntmux/processing/tv/TV.php b/nntmux/processing/tv/TV.php index 9c611e159..8248790a5 100755 --- a/nntmux/processing/tv/TV.php +++ b/nntmux/processing/tv/TV.php @@ -438,10 +438,10 @@ abstract class TV extends Videos */ public function getBySeasonEp($id, $series, $episode, $airdate = '') { - if (!empty($airdate)) { - $queryString = sprintf('DATE(tve.firstaired) = %s', $this->pdo->escapeString(date('Y-m-d', strtotime($airdate)))); - } else if ($series > 0 && $episode > 0) { + if ($series > 0 && $episode > 0) { $queryString = sprintf('tve.series = %d AND tve.episode = %d', $series, $episode); + } else if (!empty($airdate)) { + $queryString = sprintf('DATE(tve.firstaired) = %s', $this->pdo->escapeString(date('Y-m-d', strtotime($airdate)))); } else { return false; } From 4a10e1f87a6803708d1833b17149ee4fe9ba0a7a Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 4 Dec 2016 00:19:57 +0100 Subject: [PATCH 2/3] Remove do while loop from crossposted releases check --- Changelog | 1 + nntmux/processing/ProcessReleases.php | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Changelog b/Changelog index f7ee23ecb..3265af47b 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-12-04 DariusIII + * Chg: Remove do while loop from crossposted releases check * Fix: TV processing 2016-12-02 DariusIII * Fix: Undefined notices in admin regexes pages diff --git a/nntmux/processing/ProcessReleases.php b/nntmux/processing/ProcessReleases.php index fc866df2c..3a0d48d91 100755 --- a/nntmux/processing/ProcessReleases.php +++ b/nntmux/processing/ProcessReleases.php @@ -1247,22 +1247,18 @@ class ProcessReleases if ($this->crossPostTime != 0) { // Crossposted releases. - do { - $releases = $this->pdo->queryDirect( - sprintf( - 'SELECT id, guid FROM releases WHERE adddate > (NOW() - INTERVAL %d HOUR) GROUP BY name HAVING COUNT(name) > 1', - $this->crossPostTime - ) - ); - $total = 0; - if ($releases && $releases->rowCount()) { - $total = $releases->rowCount(); - foreach ($releases as $release) { - $this->releases->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); - $duplicateDeleted++; - } + $releases = $this->pdo->queryDirect( + sprintf( + 'SELECT SQL_NO_CACHE id, guid FROM releases WHERE adddate > (NOW() - INTERVAL %d HOUR) GROUP BY name HAVING COUNT(name) > 1', + $this->crossPostTime + ) + ); + if ($releases instanceof \Traversable) { + foreach ($releases as $release) { + $this->releases->deleteSingle(['g' => $release['guid'], 'i' => $release['id']], $this->nzb, $this->releaseImage); + $duplicateDeleted++; } - } while ($total > 0); + } } if ($this->completion > 0) { From ace2d52eb278fcec5793c098e641aa1149bea858 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 4 Dec 2016 00:24:38 +0100 Subject: [PATCH 3/3] Fix books processing --- Changelog | 1 + nntmux/Books.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 3265af47b..e1239f1c7 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-12-04 DariusIII + * Fix: Books processing * Chg: Remove do while loop from crossposted releases check * Fix: TV processing 2016-12-02 DariusIII diff --git a/nntmux/Books.php b/nntmux/Books.php index cfbec97a6..f97aa7276 100755 --- a/nntmux/Books.php +++ b/nntmux/Books.php @@ -88,7 +88,8 @@ class Books $this->bookqty = (Settings::value('..maxbooksprocessed') != '') ? Settings::value('..maxbooksprocessed') : 300; $this->sleeptime = (Settings::value('..amazonsleep') != '') ? Settings::value('..amazonsleep') : 1000; $this->imgSavePath = NN_COVERS . 'book' . DS; - $this->bookreqids = (Settings::value('..book_reqids') == null || Settings::value('..book_reqids') == "") ? Category::BOOKS_MAGAZINES : Settings::value('book_reqids'); + $result = Settings::value('..book_reqids'); + $this->bookreqids = empty($result) ? Category::BOOKS_EBOOK : $result; $this->renamed = ''; if (Settings::value('..lookupbooks') == 2) { $this->renamed = 'AND isrenamed = 1';