diff --git a/misc/testing/Dev/renametopre.php b/misc/testing/Dev/renametopre.php index a358f43fa..43583735c 100644 --- a/misc/testing/Dev/renametopre.php +++ b/misc/testing/Dev/renametopre.php @@ -251,7 +251,7 @@ function resetSearchnames() global $pdo; echo $pdo->log->header("Resetting blank searchnames."); $bad = $pdo->queryDirect( - "UPDATE releases SET videos_id = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " . "prehashid = 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 = -1, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " + "UPDATE releases SET videos_id = 0, seriesfull = NULL, season = NULL, episode = NULL, tvtitle = NULL, tvairdate = NULL, imdbid = NULL, musicinfoid = NULL, consoleinfoid = NULL, bookinfoid = NULL, anidbid = NULL, " . "prehashid = 0, searchname = name, isrenamed = 0, iscategorized = 0 WHERE LENGTH(searchname) <= 8 AND LENGTH(name) > 8" ); $total = $run->rowCount(); diff --git a/misc/testing/PostProc/check_previews.php b/misc/testing/PostProc/check_previews.php index b508e9452..b685eb536 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, musicinfoid = NULL, bookinfoid = NULL, videos_id = -1, xxxinfo_id = 0, passwordstatus = -1, haspreview = -1, jpgstatus = 0, videostatus = 0, audiostatus = 0, nfostatus = -1 WHERE id = %s", $row['id'])); + sprintf("UPDATE releases SET consoleinfoid = NULL, gamesinfo_id = 0, imdbid = NULL, musicinfoid = 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'])); } } diff --git a/misc/testing/recategorize.php b/misc/testing/recategorize.php index 368d80880..c041f9e4e 100644 --- a/misc/testing/recategorize.php +++ b/misc/testing/recategorize.php @@ -84,7 +84,7 @@ function categorizeRelease($update = true, $where, $echooutput = false) sprintf(" UPDATE releases SET iscategorized = 1, - videos_id = -1, + videos_id = 0, seriesfull = NULL, season = NULL, episode = NULL, diff --git a/misc/update_scripts/python/postprocess_threaded.py b/misc/update_scripts/python/postprocess_threaded.py index 218ae50e2..2c1c6e0b0 100644 --- a/misc/update_scripts/python/postprocess_threaded.py +++ b/misc/update_scripts/python/postprocess_threaded.py @@ -142,7 +142,7 @@ elif sys.argv[1] == "movie": cur[0].execute("SELECT LEFT(guid, 1) FROM releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND imdbid IS NULL AND categoryid BETWEEN 2000 AND 2999 GROUP BY LEFT(guid, 1) "+orderBY+" LIMIT 16") datas = cur[0].fetchall() elif sys.argv[1] == "tv" and len(sys.argv) == 3 and sys.argv[2] == "clean": - cur[0].execute("SELECT LEFT(guid, 1) FROM releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND videos_id = -1 AND categoryid BETWEEN 5000 AND 5999 GROUP BY LEFT(guid, 1) "+orderBY+" LIMIT 16") + cur[0].execute("SELECT LEFT(guid, 1) FROM releases WHERE nzbstatus = 1 AND isrenamed = 1 AND searchname IS NOT NULL AND videos_id = 0 AND categoryid BETWEEN 5000 AND 5999 GROUP BY LEFT(guid, 1) "+orderBY+" LIMIT 16") datas = cur[0].fetchall() elif sys.argv[1] == "tv": cur[0].execute("SELECT LEFT(guid, 1) FROM releases WHERE nzbstatus = 1 AND searchname IS NOT NULL AND videos_id = 0 AND categoryid BETWEEN 5000 AND 5999 GROUP BY LEFT(guid, 1) "+orderBY+" LIMIT 16") diff --git a/newzdash/lib/dashdata.php b/newzdash/lib/dashdata.php index 4bcbaead5..db7fd02d9 100644 --- a/newzdash/lib/dashdata.php +++ b/newzdash/lib/dashdata.php @@ -180,7 +180,7 @@ class DashData (consoleinfoid IS NULL AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in ( select id from category where parentid = 1000 AND categoryid != 1050)) OR (imdbid IS NULL AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in ( select id from category where parentid = 2000 AND categoryid != 2020)) OR (musicinfoid IS NULL AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in ( select id from category where parentid = 3000 AND categoryid != 3050)) OR - (videos_id = -1 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in ( select id from category where parentid = 5000 AND categoryid != 5050)) OR + (videos_id = 0 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in ( select id from category where parentid = 5000 AND categoryid != 5050)) OR (xxxinfo_id = 0 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid in (select id from category where parentid = 6000 AND categoryid != 6070)) OR (gamesinfo_id = 0 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0 and categoryid = 4050)'); diff --git a/newzdash/lib/stats.php b/newzdash/lib/stats.php index 0ccf8673e..a80d72cb2 100644 --- a/newzdash/lib/stats.php +++ b/newzdash/lib/stats.php @@ -173,7 +173,7 @@ class Stats and categoryid = 4050;"; /////////////amount of tv left to do///////// $tvrage_query = "SELECT count(*) as todo from releases - where (videos_id = -1 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0) + where (videos_id = 0 AND isrenamed = 0 AND proc_pp = 0 AND proc_par2 = 0 AND proc_nfo = 0 AND proc_files = 0 AND proc_sorter = 0) and categoryid in ( select id from category where parentid = 5000 AND categoryid != 5050);"; /////////////amount of XXX left to do///////// $xxx_query = "SELECT count(*) as todo from releases diff --git a/newznab/Releases.php b/newznab/Releases.php index 34580c1b7..c3a06101f 100755 --- a/newznab/Releases.php +++ b/newznab/Releases.php @@ -654,17 +654,14 @@ class Releases } /** - * Used for updating releases on site. - * - * @param array $guids - * @param int $category - * @param int $grabs - * @param int $videoId - * @param $episodeId - * @param int $imdDbID + * @param $guids + * @param $category + * @param $grabs + * @param $videoId + * @param $episodeId + * @param $imdDbID * * @return array|bool|int - * @internal param string $season */ public function updatemulti($guids, $category, $grabs, $videoId, $episodeId, $imdDbID) { @@ -1323,15 +1320,14 @@ class Releases */ public function getById($id) { - return $this->pdo->queryOneRow( - sprintf( - 'SELECT r.*, g.name AS group_name + $qry = sprintf(' + SELECT r.*, g.name AS group_name FROM releases r INNER JOIN groups g ON g.id = r.groupid WHERE r.id = %d', - $id - ) + $id ); + return $this->pdo->queryOneRow($qry); } /** diff --git a/www/pages/ajax_release-admin.php b/www/pages/ajax_release-admin.php index 7ceb4b1f6..129d87d88 100644 --- a/www/pages/ajax_release-admin.php +++ b/www/pages/ajax_release-admin.php @@ -1,40 +1,47 @@ $page->settings]); +$category = new Category(['Settings' => $page->settings]); -// set the current action +// Set the current action. $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; -$id = (isset($_REQUEST['id']) && is_array($_REQUEST['id'])) ? $_REQUEST['id'] : ''; + +// Request is for id, but guid is actually being provided +if (isset($_REQUEST['id']) && is_array($_REQUEST['id'])) { + $id = $_REQUEST['id']; + //Get info for first guid to populate form + $rel = $releases->getByGuid($_REQUEST['id'][0]); +} else { + $id = $rel = ''; +} $page->smarty->assign('action', $action); $page->smarty->assign('idArr', $id); -switch($action) -{ +switch ($action) { case 'doedit': case 'edit': $success = false; - if ($action == 'doedit') - { - $upd = $releases->updatemulti($_REQUEST["id"], $_REQUEST["category"], $_REQUEST["grabs"], $_REQUEST["rageID"], $_REQUEST["season"], $_REQUEST['imdbID']); + if ($action == 'doedit') { + $upd = $releases->updatemulti($_REQUEST["id"], $_REQUEST["category"], $_REQUEST["grabs"], $_REQUEST["videosid"], $_REQUEST["episodesid"], $_REQUEST['imdbid']); if ($upd !== false) { $success = true; } else { } } + $page->smarty->assign('release', $rel); $page->smarty->assign('success', $success); - $page->smarty->assign('from',(isset($_REQUEST['from'])?$_REQUEST['from']:'')); - $page->smarty->assign('catlist',$category->getForSelect()); + $page->smarty->assign('from', (isset($_REQUEST['from']) ? $_REQUEST['from'] : '')); + $page->smarty->assign('catlist', $category->getForSelect(false)); $page->content = $page->smarty->fetch('ajax_release-edit.tpl'); echo $page->content; - break; + break; case 'dodelete': $is_guid = true; if (is_array($_GET['id'])) { @@ -51,4 +58,4 @@ switch($action) default: $page->show404(); break; -} +} \ No newline at end of file diff --git a/www/themes/charisma/templates/frontend/myshows.tpl b/www/themes/charisma/templates/frontend/myshows.tpl index e0003705c..853fc2cab 100644 --- a/www/themes/charisma/templates/frontend/myshows.tpl +++ b/www/themes/charisma/templates/frontend/myshows.tpl @@ -34,7 +34,7 @@ {$show.title|escape:"htmlall"|wordwrap:75:"\n":true} + href="{$smarty.const.WWW_TOP}/series/{$show.id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} @@ -43,11 +43,11 @@
Edit + href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.id}" + rel="edit" name="series{$show.id}" title="Edit Categories">Edit Remove
diff --git a/www/themes/nntmux/templates/frontend/myshows.tpl b/www/themes/nntmux/templates/frontend/myshows.tpl index 116ed1a48..e636f62c9 100644 --- a/www/themes/nntmux/templates/frontend/myshows.tpl +++ b/www/themes/nntmux/templates/frontend/myshows.tpl @@ -20,11 +20,11 @@ {foreach from=$shows item=show} - {$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true} + {$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} {$show.createddate|date_format} - Edit  Remove + Edit  Remove {/foreach} diff --git a/www/themes/omicron/templates/frontend/myshows.tpl b/www/themes/omicron/templates/frontend/myshows.tpl index e0003705c..853fc2cab 100644 --- a/www/themes/omicron/templates/frontend/myshows.tpl +++ b/www/themes/omicron/templates/frontend/myshows.tpl @@ -34,7 +34,7 @@ {$show.title|escape:"htmlall"|wordwrap:75:"\n":true} + href="{$smarty.const.WWW_TOP}/series/{$show.id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} @@ -43,11 +43,11 @@
Edit + href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.id}" + rel="edit" name="series{$show.id}" title="Edit Categories">Edit Remove
diff --git a/www/themes_shared/templates/admin/ajax_release-edit.tpl b/www/themes_shared/templates/admin/ajax_release-edit.tpl index 8a30f6cd9..2a42457b9 100644 --- a/www/themes_shared/templates/admin/ajax_release-edit.tpl +++ b/www/themes_shared/templates/admin/ajax_release-edit.tpl @@ -38,15 +38,15 @@ - + - + - + - +