From c981281d19187a9e41a338026269c1406ca0478b Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 10 May 2016 09:31:00 +0200 Subject: [PATCH] Rename bookinfoid to bookinfo_id, consoleinfoid to consoleinfo_id and pre_id to predb_id --- Changelog | 1 + misc/testing/DB/reset_postprocessing.php | 16 ++++++++-------- misc/testing/PostProc/check_previews.php | 2 +- misc/testing/PostProc/getConsole.php | 2 +- misc/testing/PreDB/dump_predb.php | 12 ++++++------ misc/testing/Releases/recategorize.php | 4 ++-- misc/testing/Various/renametopre.php | 8 ++++---- newznab/Books.php | 12 ++++++------ newznab/Console.php | 10 +++++----- newznab/MiscSorter.php | 10 +++++----- newznab/NameFixer.php | 6 +++--- newznab/RSS.php | 2 +- newznab/Releases.php | 12 ++++++------ newznab/RequestIDLocal.php | 4 ++-- newznab/RequestIDWeb.php | 2 +- newznab/Tmux.php | 4 ++-- newznab/processing/post/ProcessAdditional.php | 2 +- resources/db/patches/mysql/+2~predb_hashes.sql | 4 ++++ resources/db/schema/nntmux_fi_schema.sql | 16 ++++++++-------- resources/db/schema/schema.sql | 12 ++++++------ www/pages/details.php | 8 ++++---- www/pages/preinfo.php | 4 ++-- www/themes/Charisma/templates/books.tpl | 4 ++-- www/themes/Charisma/templates/console.tpl | 4 ++-- www/themes/Charisma/templates/newposterwall.tpl | 4 ++-- www/themes/Charisma/templates/search.tpl | 4 ++-- www/themes/Gamma/templates/books.tpl | 4 ++-- www/themes/Gamma/templates/browse.tpl | 8 ++++---- www/themes/Gamma/templates/console.tpl | 4 ++-- www/themes/Gamma/templates/newposterwall.tpl | 4 ++-- www/themes/Gamma/templates/search.tpl | 8 ++++---- www/themes/Gentele/templates/books.tpl | 4 ++-- www/themes/Gentele/templates/console.tpl | 4 ++-- www/themes/Gentele/templates/newposterwall.tpl | 4 ++-- www/themes/Gentele/templates/search.tpl | 4 ++-- www/themes/Omicron/templates/books.tpl | 4 ++-- www/themes/Omicron/templates/console.tpl | 4 ++-- www/themes/Omicron/templates/newposterwall.tpl | 4 ++-- www/themes/Omicron/templates/search.tpl | 4 ++-- www/themes/shared/templates/rss.tpl | 6 +++--- 40 files changed, 120 insertions(+), 115 deletions(-) create mode 100644 resources/db/patches/mysql/+2~predb_hashes.sql diff --git a/Changelog b/Changelog index 9e178d1f4..808c348d7 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-05-10 DariusIII + * Chg: Rename bookinfoid to bookinfo_id, consoleinfoid to consoleinfo_id and pre_id to predb_id * Chg: Rename musicinfoid to musicinfo_id * Chg: Rename preid to predb_id in releases table and in classes and scripts. * Chg: Move collection deletion right after NZB is created. diff --git a/misc/testing/DB/reset_postprocessing.php b/misc/testing/DB/reset_postprocessing.php index 5f1ac2e80..4639eb5ee 100755 --- a/misc/testing/DB/reset_postprocessing.php +++ b/misc/testing/DB/reset_postprocessing.php @@ -41,8 +41,8 @@ if (isset($argv[1]) && $argv[1] === "all") { $pdo->queryExec( sprintf(" UPDATE releases - SET consoleinfoid = NULL, gamesinfo_id = 0, imdbid = NULL, musicinfo_id = NULL, - bookinfoid = NULL, videos_id = 0, tv_episodes_id = 0, xxxinfo_id = 0, passwordstatus = -1, haspreview = -1, + SET consoleinfo_id = NULL, gamesinfo_id = 0, imdbid = NULL, musicinfo_id = NULL, + bookinfo_id = NULL, videos_id = 0, tv_episodes_id = 0, xxxinfo_id = 0, passwordstatus = -1, haspreview = -1, jpgstatus = 0, videostatus = 0, audiostatus = 0, nfostatus = -1 WHERE id = %d", $releases['id'] @@ -60,10 +60,10 @@ if (isset($argv[1]) && ($argv[1] === "consoles" || $argv[1] === "all")) { } if (isset($argv[2]) && $argv[2] === "true") { echo $pdo->log->header("Resetting all Console postprocessing"); - $where = ' WHERE consoleinfoid IS NOT NULL'; + $where = ' WHERE consoleinfo_id IS NOT NULL'; } else { echo $pdo->log->header("Resetting all failed Console postprocessing"); - $where = " WHERE consoleinfoid IN (-2, 0) AND categories_id BETWEEN " . Category::GAME_ROOT . " AND " . Category::GAME_OTHER; + $where = " WHERE consoleinfo_id IN (-2, 0) AND categories_id BETWEEN " . Category::GAME_ROOT . " AND " . Category::GAME_OTHER; } $qry = $pdo->queryDirect("SELECT id FROM releases" . $where); @@ -75,7 +75,7 @@ if (isset($argv[1]) && ($argv[1] === "consoles" || $argv[1] === "all")) { $concount = 0; if ($qry instanceof \Traversable) { foreach ($qry as $releases) { - $pdo->queryExec("UPDATE releases SET consoleinfoid = NULL WHERE id = " . $releases['id']); + $pdo->queryExec("UPDATE releases SET consoleinfo_id = NULL WHERE id = " . $releases['id']); $consoletools->overWritePrimary("Resetting Console Releases: " . $consoletools->percentString(++$concount, $total)); } } @@ -253,10 +253,10 @@ if (isset($argv[1]) && ($argv[1] === "books" || $argv[1] === "all")) { } if (isset($argv[2]) && $argv[2] === "true") { echo $pdo->log->header("Resetting all Book postprocessing"); - $where = ' WHERE bookinfoid IS NOT NULL'; + $where = ' WHERE bookinfo_id IS NOT NULL'; } else { echo $pdo->log->header("Resetting all failed Book postprocessing"); - $where = " WHERE bookinfoid IN (-2, 0) AND categories_id BETWEEN " . Category::BOOKS_ROOT . " AND " . Category::BOOKS_UNKNOWN; + $where = " WHERE bookinfo_id IN (-2, 0) AND categories_id BETWEEN " . Category::BOOKS_ROOT . " AND " . Category::BOOKS_UNKNOWN; } $qry = $pdo->queryDirect("SELECT id FROM releases" . $where); @@ -264,7 +264,7 @@ if (isset($argv[1]) && ($argv[1] === "books" || $argv[1] === "all")) { $concount = 0; if ($qry instanceof \Traversable) { foreach ($qry as $releases) { - $pdo->queryExec("UPDATE releases SET bookinfoid = NULL WHERE id = " . $releases['id']); + $pdo->queryExec("UPDATE releases SET bookinfo_id = NULL WHERE id = " . $releases['id']); $consoletools->overWritePrimary("Resetting Book Releases: " . $consoletools->percentString(++$concount, $total)); } } diff --git a/misc/testing/PostProc/check_previews.php b/misc/testing/PostProc/check_previews.php index 0d1b0266a..8f28a3e2d 100644 --- a/misc/testing/PostProc/check_previews.php +++ b/misc/testing/PostProc/check_previews.php @@ -42,7 +42,7 @@ if (isset($argv[1]) && ($argv[1] === "true" || $argv[1] === "check")) { echo $pdo->log->warning("Missing preview " . $nzbpath); if ($argv[1] === "true") { $pdo->queryExec( - sprintf("UPDATE releases SET consoleinfoid = NULL, gamesinfo_id = 0, imdbid = NULL, musicinfo_id = NULL, bookinfoid = NULL, videos_id = 0, xxxinfo_id = 0, passwordstatus = -1, haspreview = -1, jpgstatus = 0, videostatus = 0, audiostatus = 0, nfostatus = -1 WHERE id = %s", $row['id'])); + sprintf("UPDATE releases SET consoleinfo_id = NULL, gamesinfo_id = 0, imdbid = NULL, musicinfo_id = NULL, bookinfo_id = NULL, videos_id = 0, xxxinfo_id = 0, passwordstatus = -1, haspreview = -1, jpgstatus = 0, videostatus = 0, audiostatus = 0, nfostatus = -1 WHERE id = %s", $row['id'])); } } diff --git a/misc/testing/PostProc/getConsole.php b/misc/testing/PostProc/getConsole.php index b8a0cd9fa..7308086b1 100644 --- a/misc/testing/PostProc/getConsole.php +++ b/misc/testing/PostProc/getConsole.php @@ -15,7 +15,7 @@ $console = new Console(['Echo' => true, 'Settings' => $pdo]); $res = $pdo->queryDirect( sprintf( - "SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categories_id + "SELECT searchname, id FROM releases WHERE consoleinfo_id IS NULL AND categories_id BETWEEN %s AND %s ORDER BY id DESC", Category::GAME_ROOT, Category::GAME_OTHER diff --git a/misc/testing/PreDB/dump_predb.php b/misc/testing/PreDB/dump_predb.php index f5b946315..737081c76 100644 --- a/misc/testing/PreDB/dump_predb.php +++ b/misc/testing/PreDB/dump_predb.php @@ -96,17 +96,17 @@ SQL_INSERT; // Add hashes g echo $pdo->log->info("Adding predb_hashes entries"); echo $pdo->log->info("Stage 1: UNHEX(MD5(TITLE))"); - $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, pre_id) SELECT UNHEX(md5(title)), id from predb;"); + $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, predb_id) SELECT UNHEX(md5(title)), id from predb;"); echo $pdo->log->info("Stage 1: UNHEX(MD5(MD5(TITLE)))"); - $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, pre_id) SELECT UNHEX(md5(md5(title))), id from predb;"); + $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, predb_id) SELECT UNHEX(md5(md5(title))), id from predb;"); echo $pdo->log->info("Stage 1: UNHEX(SHA1(TITLE))"); - $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, pre_id) SELECT UNHEX(sha1(title)), id from predb;"); + $pdo->queryExec("INSERT IGNORE INTO predb_hashes (hash, predb_id) SELECT UNHEX(sha1(title)), id from predb;"); // Re-add triggers on predb echo $pdo->log->info("Adding predb_hashes triggers"); - $pdo->queryExec("CREATE TRIGGER insert_hashes AFTER INSERT ON predb FOR EACH ROW BEGIN INSERT INTO predb_hashes (hash, pre_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); END;"); - $pdo->queryExec("CREATE TRIGGER update_hashes AFTER UPDATE ON predb FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; INSERT INTO predb_hashes (hash, pre_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); END IF; END;"); - $pdo->queryExec("CREATE TRIGGER delete_hashes BEGIN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; END;"); + $pdo->queryExec("CREATE TRIGGER insert_hashes AFTER INSERT ON predb FOR EACH ROW BEGIN INSERT INTO predb_hashes (hash, predb_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); END;"); + $pdo->queryExec("CREATE TRIGGER update_hashes AFTER UPDATE ON predb FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; INSERT INTO predb_hashes (hash, predb_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); END IF; END;"); + $pdo->queryExec("CREATE TRIGGER delete_hashes BEGIN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; END;"); $pdo->queryExec("TRUNCATE TABLE predb_imports"); } else { diff --git a/misc/testing/Releases/recategorize.php b/misc/testing/Releases/recategorize.php index 9d140fb8e..826b183ab 100644 --- a/misc/testing/Releases/recategorize.php +++ b/misc/testing/Releases/recategorize.php @@ -89,9 +89,9 @@ function categorizeRelease($where, $update = true, $echooutput = false) tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, - consoleinfoid = NULL, + consoleinfo_id = NULL, gamesinfo_id = 0, - bookinfoid = NULL, + bookinfo_id = NULL, anidbid = NULL, xxxinfo_id = 0, categories_id = %d diff --git a/misc/testing/Various/renametopre.php b/misc/testing/Various/renametopre.php index b419621e7..50ec61db1 100644 --- a/misc/testing/Various/renametopre.php +++ b/misc/testing/Various/renametopre.php @@ -159,14 +159,14 @@ function preName($argv, $argc) if ($propername == true) { $pdo->queryExec( sprintf( - "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, " . "iscategorized = 1, isrenamed = 1, searchname = %s, categories_id = %d, predb_id = " . $preid . " WHERE id = %d", $pdo->escapeString($cleanName), $determinedcat, $row['id'] ) ); } else { $pdo->queryExec( sprintf( - "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, " . "iscategorized = 1, searchname = %s, categories_id = %d, predb_id = " . $preid . " WHERE id = %d", $pdo->escapeString($cleanName), $determinedcat, $row['id'] ) ); @@ -251,7 +251,7 @@ function resetSearchnames() global $pdo; echo $pdo->log->header("Resetting blank searchnames."); $bad = $pdo->queryDirect( - "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, " . "predb_id = 0, searchname = name, isrenamed = 0, iscategorized = 0 WHERE searchname = ''" ); $tot = $bad->rowCount(); @@ -260,7 +260,7 @@ function resetSearchnames() } echo $pdo->log->header("Resetting searchnames that are 8 characters or less."); $run = $pdo->queryDirect( - "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, " . "predb_id = 0, searchname = name, isrenamed = 0, iscategorized = 0 WHERE LENGTH(searchname) <= 8 AND LENGTH(name) > 8" ); $total = $run->rowCount(); diff --git a/newznab/Books.php b/newznab/Books.php index ea316df82..7aec19b4e 100644 --- a/newznab/Books.php +++ b/newznab/Books.php @@ -188,7 +188,7 @@ class Books SELECT SQL_CALC_FOUND_ROWS boo.id, GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id FROM bookinfo boo - LEFT JOIN releases r ON boo.id = r.bookinfoid + LEFT JOIN releases r ON boo.id = r.bookinfo_id WHERE r.nzbstatus = 1 AND boo.cover = 1 AND boo.title != '' @@ -233,14 +233,14 @@ class Books GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, GROUP_CONCAT(df.failed ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_failed, boo.*, - r.bookinfoid, + r.bookinfo_id, g.name AS group_name, rn.id AS nfoid FROM releases r LEFT OUTER JOIN groups g ON g.id = r.groupid LEFT OUTER JOIN release_nfos rn ON rn.releaseid = r.id LEFT OUTER JOIN dnzb_failures df ON df.release_id = r.id - INNER JOIN bookinfo boo ON boo.id = r.bookinfoid + INNER JOIN bookinfo boo ON boo.id = r.bookinfo_id WHERE boo.id IN (%s) AND r.id IN (%s) AND %s @@ -392,7 +392,7 @@ class Books SELECT searchname, id, categories_id FROM releases WHERE nzbstatus = 1 %s - AND bookinfoid IS NULL + AND bookinfo_id IS NULL AND categories_id in (%s) ORDER BY postdate DESC LIMIT %d', $this->renamed, $bookids[$i], $this->bookqty) @@ -454,9 +454,9 @@ class Books } // Update release. - $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoid = %d WHERE id = %d', $bookId, $arr['id'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfo_id = %d WHERE id = %d', $bookId, $arr['id'])); } else { // Could not parse release title. - $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfoid = %d WHERE id = %d', -2, $arr['id'])); + $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfo_id = %d WHERE id = %d', -2, $arr['id'])); if ($this->echooutput) { echo '.'; } diff --git a/newznab/Console.php b/newznab/Console.php index f07407fc6..8704a78f7 100644 --- a/newznab/Console.php +++ b/newznab/Console.php @@ -186,7 +186,7 @@ class Console con.id, GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id FROM consoleinfo con - LEFT JOIN releases r ON con.id = r.consoleinfoid + LEFT JOIN releases r ON con.id = r.consoleinfo_id WHERE r.nzbstatus = 1 AND con.title != '' AND con.cover = 1 @@ -231,7 +231,7 @@ class Console GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, GROUP_CONCAT(df.failed ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_failed, con.*, - r.consoleinfoid, + r.consoleinfo_id, g.name AS group_name, genres.title AS genre, rn.id AS nfoid @@ -239,7 +239,7 @@ class Console LEFT OUTER JOIN groups g ON g.id = r.groupid LEFT OUTER JOIN release_nfos rn ON rn.releaseid = r.id LEFT OUTER JOIN dnzb_failures df ON df.release_id = r.id - INNER JOIN consoleinfo con ON con.id = r.consoleinfoid + INNER JOIN consoleinfo con ON con.id = r.consoleinfo_id INNER JOIN genres ON con.genreid = genres.id WHERE con.id IN (%s) AND r.id IN (%s) @@ -760,7 +760,7 @@ class Console SELECT searchname, id FROM releases WHERE nzbstatus = %d %s - AND consoleinfoid IS NULL %s + AND consoleinfo_id IS NULL %s ORDER BY postdate DESC LIMIT %d', NZB::NZB_ADDED, @@ -829,7 +829,7 @@ class Console $this->pdo->queryExec( sprintf(' UPDATE releases - SET consoleinfoid = %d + SET consoleinfo_id = %d WHERE id = %d %s', $gameId, $arr['id'], diff --git a/newznab/MiscSorter.php b/newznab/MiscSorter.php index 1a1c9a653..b7fef39e3 100644 --- a/newznab/MiscSorter.php +++ b/newznab/MiscSorter.php @@ -252,7 +252,7 @@ class MiscSorter $this->_setProcSorter(self::PROC_SORTER_DONE, $id); } - if ($type !== '' && in_array($type, ['bookinfoid', 'consoleinfoid', 'imdbid', 'musicinfo_id'])) { + if ($type !== '' && in_array($type, ['bookinfo_id', 'consoleinfo_id', 'imdbid', 'musicinfo_id'])) { $this->pdo->queryExec( sprintf(' UPDATE releases @@ -478,9 +478,9 @@ class MiscSorter } if ($audiobook) { - $ok = $this->dodbupdate($id, $name, $bookId, 'bookinfoid'); + $ok = $this->dodbupdate($id, $name, $bookId, 'bookinfo_id'); } else { - $ok = $this->dodbupdate($id, $name, $bookId, 'bookinfoid'); + $ok = $this->dodbupdate($id, $name, $bookId, 'bookinfo_id'); } return $ok; @@ -570,7 +570,7 @@ class MiscSorter $rel = $this->_doAmazonLocal('consoleinfo', (string)$response->Items->Item->ASIN); if ($rel !== false) { - $ok = $this->dodbupdate($id, $name, $rel['id'], 'consoleinfoid'); + $ok = $this->dodbupdate($id, $name, $rel['id'], 'consoleinfo_id'); } else { $consoleId = $this->console-> updateConsoleInfo([ @@ -579,7 +579,7 @@ class MiscSorter 'platform' => (string)$response->Items->Item->ItemAttributes->Platform ] ); - $ok = $this->dodbupdate($id, $name, $consoleId, 'consoleinfoid'); + $ok = $this->dodbupdate($id, $name, $consoleId, 'consoleinfo_id'); } return $ok; diff --git a/newznab/NameFixer.php b/newznab/NameFixer.php index 37194076f..3f76c5341 100755 --- a/newznab/NameFixer.php +++ b/newznab/NameFixer.php @@ -691,7 +691,7 @@ class NameFixer sprintf(' UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, predb_id = %d, + consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, predb_id = %d, searchname = %s, %s categories_id = %d WHERE id = %d', $preId, @@ -708,7 +708,7 @@ class NameFixer sprintf(' UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, predb_id = %d, + consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, predb_id = %d, searchname = %s, iscategorized = 1, categories_id = %d WHERE id = %d', $preId, @@ -1005,7 +1005,7 @@ class NameFixer $row = $pdo->queryOneRow( sprintf(" SELECT p.id AS predb_id, p.title, p.source - FROM predb p INNER JOIN predb_hashes h ON h.pre_id = p.id + FROM predb p INNER JOIN predb_hashes h ON h.predb_id = p.id WHERE h.hash = UNHEX(%s) LIMIT 1", $pdo->escapeString($hash) diff --git a/newznab/RSS.php b/newznab/RSS.php index 7ed81575e..f175a0789 100644 --- a/newznab/RSS.php +++ b/newznab/RSS.php @@ -83,7 +83,7 @@ Class RSS LEFT OUTER JOIN movieinfo m ON m.imdbid = r.imdbid AND m.title != '' LEFT OUTER JOIN musicinfo mu ON mu.id = r.musicinfo_id LEFT OUTER JOIN genres mug ON mug.id = mu.genreid - LEFT OUTER JOIN consoleinfo co ON co.id = r.consoleinfoid + LEFT OUTER JOIN consoleinfo co ON co.id = r.consoleinfo_id LEFT OUTER JOIN genres cog ON cog.id = co.genreid %s LEFT OUTER JOIN tv_episodes tve ON tve.id = r.tv_episodes_id WHERE r.passwordstatus %s diff --git a/newznab/Releases.php b/newznab/Releases.php index 7e6099daf..57d83e947 100755 --- a/newznab/Releases.php +++ b/newznab/Releases.php @@ -1478,15 +1478,15 @@ class Releases public function getNewestConsole() { return $this->pdo->query( - "SELECT r.consoleinfoid, r.guid, r.name, r.searchname, r.size, r.completion, + "SELECT r.consoleinfo_id, r.guid, r.name, r.searchname, r.size, r.completion, r.postdate, r.categories_id, r.comments, r.grabs, con.cover FROM releases r - INNER JOIN consoleinfo con ON r.consoleinfoid = con.id + INNER JOIN consoleinfo con ON r.consoleinfo_id = con.id WHERE r.categories_id BETWEEN " . Category::GAME_ROOT . " AND " . Category::GAME_OTHER . " AND con.id > 0 AND con.cover > 0 - AND r.id in (select max(id) from releases where consoleinfoid > 0 group by consoleinfoid) + AND r.id in (select max(id) from releases where consoleinfo_id > 0 group by consoleinfo_id) ORDER BY r.postdate DESC LIMIT 35" ); @@ -1545,16 +1545,16 @@ class Releases public function getNewestBooks() { return $this->pdo->query( - "SELECT r.bookinfoid, r.guid, r.name, r.searchname, r.size, r.completion, + "SELECT r.bookinfo_id, r.guid, r.name, r.searchname, r.size, r.completion, r.postdate, r.categories_id, r.comments, r.grabs, b.url, b.cover, b.title as booktitle, b.author FROM releases r - INNER JOIN bookinfo b ON r.bookinfoid = b.id + INNER JOIN bookinfo b ON r.bookinfo_id = b.id WHERE r.categories_id BETWEEN " . Category::BOOKS_ROOT . " AND " . Category::BOOKS_UNKNOWN . " OR r.categories_id = " . Category::MUSIC_AUDIOBOOK ." AND b.id > 0 AND b.cover > 0 - AND r.id in (select max(id) from releases where bookinfoid > 0 group by bookinfoid) + AND r.id in (select max(id) from releases where bookinfo_id > 0 group by bookinfo_id) ORDER BY r.postdate DESC LIMIT 24", true, NN_CACHE_EXPIRY_LONG ); diff --git a/newznab/RequestIDLocal.php b/newznab/RequestIDLocal.php index 6b780b796..d18c6c7dc 100644 --- a/newznab/RequestIDLocal.php +++ b/newznab/RequestIDLocal.php @@ -273,8 +273,8 @@ class RequestIDLocal extends RequestID $this->pdo->queryExec( sprintf(' UPDATE releases SET - videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, - bookinfoid = NULL, anidbid = NULL, predb_id = %d, reqidstatus = %d, isrenamed = 1, + videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, + bookinfo_id = NULL, anidbid = NULL, predb_id = %d, reqidstatus = %d, isrenamed = 1, iscategorized = 1, searchname = %s, categories_id = %d WHERE id = %d', $this->_newTitle['id'], diff --git a/newznab/RequestIDWeb.php b/newznab/RequestIDWeb.php index 442bf7c5b..b41c42c25 100644 --- a/newznab/RequestIDWeb.php +++ b/newznab/RequestIDWeb.php @@ -289,7 +289,7 @@ class RequestIDWeb extends RequestID $this->pdo->queryExec( sprintf(' UPDATE releases - SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, + SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, reqidstatus = %d, isrenamed = 1, proc_files = 1, searchname = %s, categories_id = %d, predb_id = %d WHERE id = %d', diff --git a/newznab/Tmux.php b/newznab/Tmux.php index 743590b2c..ac5db0d3f 100644 --- a/newznab/Tmux.php +++ b/newznab/Tmux.php @@ -390,9 +390,9 @@ class Tmux SUM(IF(nzbstatus = 1 AND categories_id = %d AND anidbid IS NULL,1,0)) AS processanime, SUM(IF(nzbstatus = 1 AND categories_id BETWEEN %d AND %d AND imdbid IS NULL,1,0)) AS processmovies, SUM(IF(nzbstatus = 1 AND categories_id IN (%d, %d, %d) AND musicinfo_id IS NULL,1,0)) AS processmusic, - SUM(IF(nzbstatus = 1 AND categories_id BETWEEN %d AND %d AND consoleinfoid IS + SUM(IF(nzbstatus = 1 AND categories_id BETWEEN %d AND %d AND consoleinfo_id IS NULL,1,0)) AS processconsole, - SUM(IF(nzbstatus = 1 AND categories_id IN (%s) AND bookinfoid IS NULL,1,0)) AS processbooks, + SUM(IF(nzbstatus = 1 AND categories_id IN (%s) AND bookinfo_id IS NULL,1,0)) AS processbooks, SUM(IF(nzbstatus = 1 AND categories_id = %d AND gamesinfo_id = 0,1,0)) AS processgames, SUM(IF(nzbstatus = 1 AND categories_id BETWEEN %d AND %d AND xxxinfo_id = 0,1,0)) AS processxxx, SUM(IF(1=1 %s,1,0)) AS processnfo, diff --git a/newznab/processing/post/ProcessAdditional.php b/newznab/processing/post/ProcessAdditional.php index 80db708a2..7e37ff912 100644 --- a/newznab/processing/post/ProcessAdditional.php +++ b/newznab/processing/post/ProcessAdditional.php @@ -2471,7 +2471,7 @@ class ProcessAdditional ' UPDATE releases SET videos_id = 0, tv_episodes_id = 0, imdbid = NULL, musicinfo_id = NULL, - consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, predb_id = 0, + consoleinfo_id = NULL, bookinfo_id = NULL, anidbid = NULL, predb_id = 0, searchname = %s, isrenamed = 1, iscategorized = 1, proc_files = 1, categories_id = %d WHERE id = %d', $newTitle, diff --git a/resources/db/patches/mysql/+2~predb_hashes.sql b/resources/db/patches/mysql/+2~predb_hashes.sql new file mode 100644 index 000000000..4cfd68e87 --- /dev/null +++ b/resources/db/patches/mysql/+2~predb_hashes.sql @@ -0,0 +1,4 @@ +# Rename pre_id to predb_id in line with lithium conventions. +ALTER TABLE predb_hashes +CHANGE COLUMN pre_id predb_id INT(11) UNSIGNED NOT NULL +COMMENT 'id, of the predb entry, this hash belongs to'; diff --git a/resources/db/schema/nntmux_fi_schema.sql b/resources/db/schema/nntmux_fi_schema.sql index 0544f1555..ac4cb98d0 100644 --- a/resources/db/schema/nntmux_fi_schema.sql +++ b/resources/db/schema/nntmux_fi_schema.sql @@ -2299,7 +2299,7 @@ CREATE TABLE IF NOT EXISTS parts ( DROP TABLE IF EXISTS predb_hashes; CREATE TABLE IF NOT EXISTS predb_hashes ( hash varbinary(20) NOT NULL DEFAULT '', - pre_id INT(11) UNSIGNED NOT NULL DEFAULT '0', + predb_id INT(11) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (hash) ) ENGINE = MyISAM @@ -2344,11 +2344,11 @@ DROP TRIGGER IF EXISTS update_hashes; DELIMITER $$ -CREATE TRIGGER delete_hashes AFTER DELETE ON predb FOR EACH ROW BEGIN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; END $$ +CREATE TRIGGER delete_hashes AFTER DELETE ON predb FOR EACH ROW BEGIN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; END $$ -CREATE TRIGGER insert_hashes AFTER INSERT ON predb FOR EACH ROW BEGIN INSERT INTO predb_hashes (hash, pre_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); END $$ +CREATE TRIGGER insert_hashes AFTER INSERT ON predb FOR EACH ROW BEGIN INSERT INTO predb_hashes (hash, predb_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); END $$ -CREATE TRIGGER update_hashes AFTER UPDATE ON predb FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; INSERT INTO predb_hashes (hash, pre_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); END IF; END $$ +CREATE TRIGGER update_hashes AFTER UPDATE ON predb FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; INSERT INTO predb_hashes (hash, predb_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); END IF; END $$ DELIMITER ; @@ -2443,8 +2443,8 @@ CREATE TABLE IF NOT EXISTS releases ( imdbid MEDIUMINT(7) UNSIGNED zerofill DEFAULT NULL, episodeinfoid INT(11) DEFAULT NULL, musicinfo_id INT(11) DEFAULT NULL, - consoleinfoid INT(11) DEFAULT NULL, - bookinfoid INT(11) DEFAULT NULL, + consoleinfo_id INT(11) DEFAULT NULL, + bookinfo_id INT(11) DEFAULT NULL, anidbid INT(11) DEFAULT NULL, reqid VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, releasenfoid INT(11) DEFAULT NULL, @@ -2483,9 +2483,9 @@ CREATE TABLE IF NOT EXISTS releases ( KEY ix_releases_imdbid (imdbid), KEY ix_releases_xxxinfo_id (xxxinfo_id), KEY ix_releases_musicinfoid (musicinfo_id,passwordstatus), - KEY ix_releases_consoleinfoid (consoleinfoid), + KEY ix_releases_consoleinfoid (consoleinfo_id), KEY ix_releases_gamesinfo_id (gamesinfo_id), - KEY ix_releases_bookinfoid (bookinfoid), + KEY ix_releases_bookinfoid (bookinfo_id), KEY ix_releases_anidbid (anidbid), KEY ix_releases_preid_searchname (predb_id,searchname), KEY ix_releases_haspreview_passwordstatus (haspreview,passwordstatus), diff --git a/resources/db/schema/schema.sql b/resources/db/schema/schema.sql index f6908c0ad..8f4d0b58e 100644 --- a/resources/db/schema/schema.sql +++ b/resources/db/schema/schema.sql @@ -618,7 +618,7 @@ CREATE TABLE sharing ( DROP TABLE IF EXISTS predbhash; CREATE TABLE predbhash ( - pre_id INT(11) UNSIGNED NOT NULL DEFAULT '0', + predb_id INT(11) UNSIGNED NOT NULL DEFAULT '0', hash VARBINARY(20) NOT NULL DEFAULT '', PRIMARY KEY (hash) ) @@ -661,26 +661,26 @@ CREATE TABLE predb_imports ( DEFAULT CHARSET =utf8 COLLATE =utf8_unicode_ci; -INSERT INTO predbhash (pre_id, hash) (SELECT id, CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title)) FROM prehash); +INSERT INTO predbhash (predb_id, hash) (SELECT id, CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title)) FROM prehash); DELIMITER $$ CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN - INSERT INTO predbhash (hash, pre_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); + INSERT INTO predbhash (hash, predb_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5(MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); END; $$ CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN - DELETE FROM predbhash WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; - INSERT INTO predbhash (hash, pre_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); + DELETE FROM predbhash WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; + INSERT INTO predbhash (hash, predb_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); END IF; END; $$ CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN - DELETE FROM predbhash WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND pre_id = OLD.id; + DELETE FROM predbhash WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; END; $$ DELIMITER ; diff --git a/www/pages/details.php b/www/pages/details.php index e9aa628e4..5afd37f44 100644 --- a/www/pages/details.php +++ b/www/pages/details.php @@ -110,15 +110,15 @@ if (isset($_GET["id"])) } $book = ''; - if ($data['bookinfoid'] != '') { + if ($data['bookinfo_id'] != '') { $b = new Books(); - $book = $b->getBookInfo($data['bookinfoid']); + $book = $b->getBookInfo($data['bookinfo_id']); } $con = ''; - if ($data['consoleinfoid'] != '') { + if ($data['consoleinfo_id'] != '') { $c = new Console(); - $con = $c->getConsoleInfo($data['consoleinfoid']); + $con = $c->getConsoleInfo($data['consoleinfo_id']); } $AniDBAPIArray = ''; diff --git a/www/pages/preinfo.php b/www/pages/preinfo.php index 07fa042c4..b3739350c 100644 --- a/www/pages/preinfo.php +++ b/www/pages/preinfo.php @@ -195,7 +195,7 @@ if (isset($_GET['type'])) { if (isset($_GET['md5']) && strlen($_GET['title']) === 32) { $db = new newznab\db\Settings(); $preData = $db->query( - sprintf('SELECT * FROM predb p INNER JOIN predb_hashes ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', + sprintf('SELECT * FROM predb p INNER JOIN predb_hashes ph ON ph.predb_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $db->escapeString($_GET['md5']), $newer, $older, @@ -212,7 +212,7 @@ if (isset($_GET['type'])) { if (isset($_GET['sha1']) && strlen($_GET['sha1']) === 40) { $db = new newznab\db\Settings(); $preData = $db->query( - sprintf('SELECT * FROM predb p INNER JOIN predb_hashes ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', + sprintf('SELECT * FROM predb p INNER JOIN predb_hashes ph ON ph.predb_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $db->escapeString($_GET['sha1']), $newer, $older, diff --git a/www/themes/Charisma/templates/books.tpl b/www/themes/Charisma/templates/books.tpl index 212036d29..c8dc67149 100755 --- a/www/themes/Charisma/templates/books.tpl +++ b/www/themes/Charisma/templates/books.tpl @@ -73,14 +73,14 @@
- {$result.author|escape:{if isset($mfailed[$m@index]) && $mfailed[$m@index] > 0} {/if} {if isset($result.url) && $result.url != ""} + name="amazon{$result.bookinfo_id}" title="View amazon page"> Amazon{/if} {if isset($mnfo[$m@index]) && $mnfo[$m@index] > 0} - {$result.title|escape:{if !empty($mfailed[$m@index])} {/if} {if $result.url != ""} Amazon{/if} {if $result.nfoid > 0} {if $type == 'Console'} + src="{$smarty.const.WWW_TOP}/covers/console/{$result.consoleinfo_id}.jpg"/> {elseif $type == 'Movies'} @@ -55,7 +55,7 @@ src="{$smarty.const.WWW_TOP}/covers/music/{$result.musicinfo_id}.jpg"/> {elseif $type == 'Books'} + src="{$smarty.const.WWW_TOP}/covers/book/{$result.bookinfo_id}.jpg"/> {elseif $type == 'PC'} diff --git a/www/themes/Charisma/templates/search.tpl b/www/themes/Charisma/templates/search.tpl index 50905bf18..a44ce499b 100755 --- a/www/themes/Charisma/templates/search.tpl +++ b/www/themes/Charisma/templates/search.tpl @@ -258,8 +258,8 @@ Cover {/if} - {if $result.consoleinfoid > 0} - 0} + Cover {/if} {if $result.videos_id > 0} diff --git a/www/themes/Gamma/templates/books.tpl b/www/themes/Gamma/templates/books.tpl index e33cb36c0..d27699a8c 100755 --- a/www/themes/Gamma/templates/books.tpl +++ b/www/themes/Gamma/templates/books.tpl @@ -86,12 +86,12 @@
- {$result.author|escape: + {$result.author|escape:
- {if $result.url != ""}Amazon{/if} + {if $result.url != ""}Amazon{/if} Grp
diff --git a/www/themes/Gamma/templates/browse.tpl b/www/themes/Gamma/templates/browse.tpl index ef5a4a52c..0ab2ba00a 100755 --- a/www/themes/Gamma/templates/browse.tpl +++ b/www/themes/Gamma/templates/browse.tpl @@ -133,11 +133,11 @@ {if $result.musicinfo_id > 0} Cover {/if} - {if $result.consoleinfoid > 0} - Cover + {if $result.consoleinfo_id > 0} + Cover {/if} - {if $result.bookinfoid > 0} - Cover + {if $result.bookinfo_id > 0} + Cover {/if} {if $result.videos_id > 0} View Series diff --git a/www/themes/Gamma/templates/console.tpl b/www/themes/Gamma/templates/console.tpl index 94df41da2..799fa29d6 100755 --- a/www/themes/Gamma/templates/console.tpl +++ b/www/themes/Gamma/templates/console.tpl @@ -134,14 +134,14 @@
- {$result.title|escape:
{if {$mnfo[$m@index]} > 0}Nfo{/if} - {if $result.url != ""}Amazon{/if} + {if $result.url != ""}Amazon{/if} Grp
diff --git a/www/themes/Gamma/templates/newposterwall.tpl b/www/themes/Gamma/templates/newposterwall.tpl index 58ab6675b..0485cb964 100755 --- a/www/themes/Gamma/templates/newposterwall.tpl +++ b/www/themes/Gamma/templates/newposterwall.tpl @@ -45,7 +45,7 @@ href="{$smarty.const.WWW_TOP}/details/{$result.guid}"> {if $type == 'Console'} + src="{$smarty.const.WWW_TOP}/covers/console/{$result.consoleinfo_id}.jpg"/> {elseif $type == 'Movies'} @@ -57,7 +57,7 @@ src="{$smarty.const.WWW_TOP}/covers/music/{$result.musicinfo_id}.jpg"/> {elseif $type == 'Books'} + src="{$smarty.const.WWW_TOP}/covers/book/{$result.bookinfo_id}.jpg"/> {elseif $type == 'PC'} diff --git a/www/themes/Gamma/templates/search.tpl b/www/themes/Gamma/templates/search.tpl index cc3aea31a..2ca5a0047 100755 --- a/www/themes/Gamma/templates/search.tpl +++ b/www/themes/Gamma/templates/search.tpl @@ -218,10 +218,10 @@ {if $result.musicinfo_id > 0} Cover {/if} - {if $result.consoleinfoid > 0} - Cover{/if} - {if $result.bookinfoid > 0} - Cover + {if $result.consoleinfo_id > 0} + Cover{/if} + {if $result.bookinfo_id > 0} + Cover {/if} {if $result.videos_id > 0} View Series diff --git a/www/themes/Gentele/templates/books.tpl b/www/themes/Gentele/templates/books.tpl index eb0efe45c..c90d5eea3 100755 --- a/www/themes/Gentele/templates/books.tpl +++ b/www/themes/Gentele/templates/books.tpl @@ -80,7 +80,7 @@
- {$result.author|escape:{if isset($mfailed[$m@index]) && $mfailed[$m@index] > 0} + name="amazon{$result.bookinfo_id}" title="View amazon page"> Amazon{/if} {if isset($mnfo[$m@index]) && $mnfo[$m@index] > 0} - {$result.title|escape:{if !empty($mfailed[$m@index])} Amazon{/if} {if $result.nfoid > 0} {if $type == 'Console'} + src="{$smarty.const.WWW_TOP}/covers/console/{$result.consoleinfo_id}.jpg"/> {elseif $type == 'Movies'} @@ -55,7 +55,7 @@ src="{$smarty.const.WWW_TOP}/covers/music/{$result.musicinfo_id}.jpg"/> {elseif $type == 'Books'} + src="{$smarty.const.WWW_TOP}/covers/book/{$result.bookinfo_id}.jpg"/> {elseif $type == 'PC'} diff --git a/www/themes/Gentele/templates/search.tpl b/www/themes/Gentele/templates/search.tpl index 1451d55a6..ec0614419 100755 --- a/www/themes/Gentele/templates/search.tpl +++ b/www/themes/Gentele/templates/search.tpl @@ -272,8 +272,8 @@ Cover {/if} - {if $result.consoleinfoid > 0} - 0} + Cover {/if} {if $result.videos_id > 0} diff --git a/www/themes/Omicron/templates/books.tpl b/www/themes/Omicron/templates/books.tpl index 212036d29..c8dc67149 100755 --- a/www/themes/Omicron/templates/books.tpl +++ b/www/themes/Omicron/templates/books.tpl @@ -73,14 +73,14 @@
- {$result.author|escape:{if isset($mfailed[$m@index]) && $mfailed[$m@index] > 0} {/if} {if isset($result.url) && $result.url != ""} + name="amazon{$result.bookinfo_id}" title="View amazon page"> Amazon{/if} {if isset($mnfo[$m@index]) && $mnfo[$m@index] > 0} - {$result.title|escape:{if !empty($mfailed[$m@index])} {/if} {if $result.url != ""} Amazon{/if} {if $result.nfoid > 0} {if $type == 'Console'} + src="{$smarty.const.WWW_TOP}/covers/console/{$result.consoleinfo_id}.jpg"/> {elseif $type == 'Movies'} @@ -55,7 +55,7 @@ src="{$smarty.const.WWW_TOP}/covers/music/{$result.musicinfo_id}.jpg"/> {elseif $type == 'Books'} + src="{$smarty.const.WWW_TOP}/covers/book/{$result.bookinfo_id}.jpg"/> {elseif $type == 'PC'} diff --git a/www/themes/Omicron/templates/search.tpl b/www/themes/Omicron/templates/search.tpl index d7e8c610d..7c04fc1d4 100755 --- a/www/themes/Omicron/templates/search.tpl +++ b/www/themes/Omicron/templates/search.tpl @@ -258,8 +258,8 @@ Cover {/if} - {if $result.consoleinfoid > 0} - 0} + Cover {/if} {if $result.videos_id > 0} diff --git a/www/themes/shared/templates/rss.tpl b/www/themes/shared/templates/rss.tpl index 413e9ba3c..490901423 100755 --- a/www/themes/shared/templates/rss.tpl +++ b/www/themes/shared/templates/rss.tpl @@ -38,12 +38,12 @@ {/if} {if isset($release.co_cover) && $release.co_cover == 1} {$release.searchname|escape: {/if} {if isset($release.bo_cover) && $release.bo_cover == 1} {$release.searchname|escape: {/if}
    @@ -119,7 +119,7 @@ {/if} {/if} {if isset($release.parentCategoryid) && $release.parentCategoryid == {$catClass::GAME_ROOT}} - {if $release.consoleinfoid > 0} + {if $release.consoleinfo_id > 0}
  • Console Info:
      {if $release.co_url != ""}