diff --git a/Changelog b/Changelog index f1c493903..1e37f764e 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2016-02-01 DariusIII + Chg: Rename CAT_BOOK_ to CAT_BOOKS_, change the book other category from 7050 to 7999 2016-01-29 DariusIII Chg: Remove utf8_encode to speed up processing of binaries and collections, fix by @izolight 2016-01-28 DariusIII diff --git a/docs/newznab_api_specification.txt b/docs/newznab_api_specification.txt index c39c3cc14..0e5096267 100755 --- a/docs/newznab_api_specification.txt +++ b/docs/newznab_api_specification.txt @@ -649,8 +649,8 @@ newznab-tmux https://github.com/DariusIII/newznab-tmux 7020 Books/Comics Comics Ebooks 7030 Books/Magazines Magazines 7040 Books/Technical Technical books - 7050 Books/Other Misc books 7060 Books/Foreign Non english books + 7999 Books/Other Misc books 100000- Custom Specific to a site diff --git a/newznab/Books.php b/newznab/Books.php index 7ebc10b62..f6c11c119 100644 --- a/newznab/Books.php +++ b/newznab/Books.php @@ -87,7 +87,7 @@ class Books $this->bookqty = ($this->pdo->getSetting('maxbooksprocessed') != '') ? $this->pdo->getSetting('maxbooksprocessed') : 300; $this->sleeptime = ($this->pdo->getSetting('amazonsleep') != '') ? $this->pdo->getSetting('amazonsleep') : 1000; $this->imgSavePath = NN_COVERS . 'book' . DS; - $this->bookreqids = ($this->pdo->getSetting('book_reqids') == null || $this->pdo->getSetting('book_reqids') == "") ? Category::CAT_BOOK_MAGS : $this->pdo->getSetting('book_reqids'); + $this->bookreqids = ($this->pdo->getSetting('book_reqids') == null || $this->pdo->getSetting('book_reqids') == "") ? Category::CAT_BOOKS_MAGAZINES : $this->pdo->getSetting('book_reqids'); $this->renamed = ''; if ($this->pdo->getSetting('lookupbooks') == 2) { $this->renamed = 'AND isrenamed = 1'; @@ -493,7 +493,7 @@ class Books $this->pdo->log->headerOver('Changing category to misc books: ') . $this->pdo->log->primary($releasename) ); } - $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %s WHERE id = %d', Category::CAT_BOOK_OTHER, $releaseID)); + $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %s WHERE id = %d', Category::CAT_BOOKS_OTHER, $releaseID)); return false; } else if (preg_match('/^([a-z0-9ΓΌ!]+ ){1,2}(N|Vol)?\d{1,4}(a|b|c)?$|^([a-z0-9]+ ){1,2}(Jan( |unar|$)|Feb( |ruary|$)|Mar( |ch|$)|Apr( |il|$)|May(?![a-z0-9])|Jun( |e|$)|Jul( |y|$)|Aug( |ust|$)|Sep( |tember|$)|O(c|k)t( |ober|$)|Nov( |ember|$)|De(c|z)( |ember|$))/i', $releasename) && !preg_match('/Part \d+/i', $releasename)) { @@ -502,7 +502,7 @@ class Books $this->pdo->log->headerOver('Changing category to magazines: ') . $this->pdo->log->primary($releasename) ); } - $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %s WHERE id = %d', Category::CAT_BOOK_COMICS, $releaseID)); + $this->pdo->queryExec(sprintf('UPDATE releases SET categoryid = %s WHERE id = %d', Category::CAT_BOOKS_COMICS, $releaseID)); return false; } else if (!empty($releasename) && !preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) { return $releasename; diff --git a/newznab/Categorize.php b/newznab/Categorize.php index f90894fc6..1ace98bd4 100644 --- a/newznab/Categorize.php +++ b/newznab/Categorize.php @@ -203,7 +203,7 @@ class Categorize extends Category if ($this->categorizeForeign && $this->isBookForeign()) { break; } - $this->tmpCat = Category::CAT_BOOK_COMICS; + $this->tmpCat = Category::CAT_BOOKS_COMICS; break; case $group === 'alt.binaries.console.ps3': if ($this->isGamePS4()) { @@ -258,13 +258,13 @@ class Categorize extends Category if ($this->categorizeForeign && $this->isBookForeign()) { break; } - $this->tmpCat = Category::CAT_BOOK_TECHNICAL; + $this->tmpCat = Category::CAT_BOOKS_TECHNICAL; break; case $group === 'alt.binaries.e-book.magazines': if ($this->categorizeForeign && $this->isBookForeign()) { break; } - $this->tmpCat = Category::CAT_BOOK_MAGS; + $this->tmpCat = Category::CAT_BOOKS_MAGAZINES; break; case $group === 'alt.binaries.e-book.rpg': switch (true) { @@ -274,7 +274,7 @@ class Categorize extends Category case $this->isBook(): break; default: - $this->tmpCat = Category::CAT_BOOK_OTHER; + $this->tmpCat = Category::CAT_BOOKS_OTHER; break; } break; @@ -287,7 +287,7 @@ class Categorize extends Category case $this->categorizeForeign && $this->isBookForeign(): break; case preg_match('/[a-z0-9 \',]+ - \[? ?[a-z0-9 \']+ ?\]? - [a-z0-9 \']+/i', $this->releaseName): - $this->tmpCat = Category::CAT_BOOK_EBOOK; + $this->tmpCat = Category::CAT_BOOKS_EBOOK; break; default: $this->tmpCat = Category::CAT_OTHER_MISC; @@ -1353,7 +1353,7 @@ class Categorize extends Category case $this->categorizeForeign === false: return false; case preg_match('/[ \-\._](brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|ita|latin|mandarin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)[-._ ]/i', $this->releaseName): - $this->tmpCat = Category::CAT_BOOK_FOREIGN; + $this->tmpCat = Category::CAT_BOOKS_FOREIGN; return true; default: return false; @@ -1368,7 +1368,7 @@ class Categorize extends Category case $this->isBookForeign(): break; default: - $this->tmpCat = Category::CAT_BOOK_COMICS; + $this->tmpCat = Category::CAT_BOOKS_COMICS; break; } return true; @@ -1382,7 +1382,7 @@ class Categorize extends Category case $this->isBookForeign(): break; default: - $this->tmpCat = Category::CAT_BOOK_TECHNICAL; + $this->tmpCat = Category::CAT_BOOKS_TECHNICAL; break; } return true; @@ -1396,7 +1396,7 @@ class Categorize extends Category case $this->isBookForeign(): break; default: - $this->tmpCat = Category::CAT_BOOK_MAGS; + $this->tmpCat = Category::CAT_BOOKS_MAGAZINES; break; } return true; @@ -1405,7 +1405,7 @@ class Categorize extends Category public function isBookOther() { if (preg_match('/"\d\d-\d\d-20\d\d\./i', $this->releaseName)) { - $this->tmpCat = Category::CAT_BOOK_OTHER; + $this->tmpCat = Category::CAT_BOOKS_OTHER; return true; } return false; @@ -1419,7 +1419,7 @@ class Categorize extends Category case $this->isBookForeign(): break; default: - $this->tmpCat = Category::CAT_BOOK_EBOOK; + $this->tmpCat = Category::CAT_BOOKS_EBOOK; break; } return true; diff --git a/newznab/Category.php b/newznab/Category.php index 327edf661..6d7b9916d 100644 --- a/newznab/Category.php +++ b/newznab/Category.php @@ -65,12 +65,12 @@ class Category const CAT_XXX_OTHER = '6070'; const CAT_XXX_SD = '6080'; const CAT_XXX_WEBDL = '6090'; - const CAT_BOOK_MAGS = '7010'; - const CAT_BOOK_EBOOK = '7020'; - const CAT_BOOK_COMICS = '7030'; - const CAT_BOOK_TECHNICAL = '7040'; - const CAT_BOOK_OTHER = '7050'; - const CAT_BOOK_FOREIGN = '7060'; + const CAT_BOOKS_MAGAZINES = '7010'; + const CAT_BOOKS_EBOOK = '7020'; + const CAT_BOOKS_COMICS = '7030'; + const CAT_BOOKS_TECHNICAL = '7040'; + const CAT_BOOKS_FOREIGN = '7060'; + const CAT_BOOKS_OTHER = '7999'; const CAT_PARENT_OTHER = '0000'; const CAT_PARENT_GAME = '1000'; const CAT_PARENT_MOVIE = '2000'; @@ -86,7 +86,7 @@ class Category const CAT_OTHERS_GROUP = [ - self::CAT_BOOK_OTHER, + self::CAT_BOOKS_OTHER, self::CAT_GAME_OTHER, self::CAT_MOVIE_OTHER, self::CAT_MUSIC_OTHER, diff --git a/newznab/ReleaseRegex.php b/newznab/ReleaseRegex.php index 4c5c9f4b2..c5e7a6dc4 100644 --- a/newznab/ReleaseRegex.php +++ b/newznab/ReleaseRegex.php @@ -253,7 +253,7 @@ class ReleaseRegex if ($cat->isPcGame($matches['name'])) $regcatid = Category::CAT_PC_GAMES; if ($cat->isEBook($matches['name'])) - $regcatid = Category::CAT_BOOK_EBOOK; + $regcatid = Category::CAT_BOOKS_EBOOK; } $reqID = ""; diff --git a/newznab/ReleaseRemover.php b/newznab/ReleaseRemover.php index 14efee1e8..33d491387 100644 --- a/newznab/ReleaseRemover.php +++ b/newznab/ReleaseRemover.php @@ -622,12 +622,12 @@ class ReleaseRemover AND r.size < 2097152 AND r.categoryid NOT IN (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d) %s", Category::CAT_MUSIC_MP3, - Category::CAT_BOOK_COMICS, - Category::CAT_BOOK_EBOOK, - Category::CAT_BOOK_FOREIGN, - Category::CAT_BOOK_MAGS, - Category::CAT_BOOK_TECHNICAL, - Category::CAT_BOOK_OTHER, + Category::CAT_BOOKS_COMICS, + Category::CAT_BOOKS_EBOOK, + Category::CAT_BOOKS_FOREIGN, + Category::CAT_BOOKS_MAGAZINES, + Category::CAT_BOOKS_TECHNICAL, + Category::CAT_BOOKS_OTHER, Category::CAT_PC_0DAY, Category::CAT_PC_GAMES, Category::CAT_OTHER_MISC, diff --git a/newznab/build/nntmux.xml b/newznab/build/nntmux.xml index 778247176..f2a785448 100755 --- a/newznab/build/nntmux.xml +++ b/newznab/build/nntmux.xml @@ -2,8 +2,8 @@ - 238 - 238 + 239 + 239 0.0.0 diff --git a/resources/db/patches/mysql/+1~category.sql b/resources/db/patches/mysql/+1~category.sql new file mode 100644 index 000000000..46dbc65a4 --- /dev/null +++ b/resources/db/patches/mysql/+1~category.sql @@ -0,0 +1 @@ +UPDATE category SET id = 7999 WHERE id = 7050; diff --git a/resources/db/patches/mysql/0239~category.sql b/resources/db/patches/mysql/0239~category.sql new file mode 100644 index 000000000..46dbc65a4 --- /dev/null +++ b/resources/db/patches/mysql/0239~category.sql @@ -0,0 +1 @@ +UPDATE category SET id = 7999 WHERE id = 7050; diff --git a/www/themes/Charisma/templates/predb.tpl b/www/themes/Charisma/templates/predb.tpl index caad900db..7c56c3055 100755 --- a/www/themes/Charisma/templates/predb.tpl +++ b/www/themes/Charisma/templates/predb.tpl @@ -174,7 +174,7 @@ {* Other *} {elseif in_array({$result.category}, array('Other: E-Books'))} Ebooks + href="{$smarty.const.WWW_TOP}/browse?t=7999">Ebooks Other {elseif in_array({$result.category}, array('', 'PRE'))} N/A diff --git a/www/themes/Gamma/templates/predb.tpl b/www/themes/Gamma/templates/predb.tpl index f33c4bbae..b6463d67d 100755 --- a/www/themes/Gamma/templates/predb.tpl +++ b/www/themes/Gamma/templates/predb.tpl @@ -174,7 +174,7 @@ {* Other *} {elseif in_array({$result.category}, array('Other: E-Books'))} Ebooks + href="{$smarty.const.WWW_TOP}/browse?t=7999">Ebooks Other {elseif in_array({$result.category}, array('', 'PRE'))} N/A diff --git a/www/themes/Omicron/templates/predb.tpl b/www/themes/Omicron/templates/predb.tpl index 654230804..905e6677a 100755 --- a/www/themes/Omicron/templates/predb.tpl +++ b/www/themes/Omicron/templates/predb.tpl @@ -174,7 +174,7 @@ {* Other *} {elseif in_array({$result.category}, array('Other: E-Books'))} Ebooks + href="{$smarty.const.WWW_TOP}/browse?t=7999">Ebooks Other {elseif in_array({$result.category}, array('', 'PRE'))} N/A