mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix more "issues" in tv
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)');
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+10
-14
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,40 +1,47 @@
|
||||
<?php
|
||||
use newznab\AdminPage;
|
||||
use newznab\Releases;
|
||||
|
||||
use newznab\Category;
|
||||
use newznab\Releases;
|
||||
|
||||
$page = new AdminPage();
|
||||
$releases = new Releases();
|
||||
$category = new Category();
|
||||
$page = new AdminPage(true);
|
||||
$releases = new Releases(['Settings' => $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;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<a title="View details"
|
||||
href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
href="{$smarty.const.WWW_TOP}/series/{$show.id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-default">{if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if}</span>
|
||||
@@ -43,11 +43,11 @@
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-xs btn-warning myshows"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.videos_id}"
|
||||
rel="edit" name="series{$show.videos_id}" title="Edit Categories">Edit</a>
|
||||
href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.id}"
|
||||
rel="edit" name="series{$show.id}" title="Edit Categories">Edit</a>
|
||||
<a class="btn btn-xs btn-danger confirm_action myshows"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.videos_id}"
|
||||
rel="remove" name="series{$show.videos_id}"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.id}"
|
||||
rel="remove" name="series{$show.id}"
|
||||
title="Remove from My Shows">Remove</a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
{foreach from=$shows item=show}
|
||||
<tr class="{cycle values=",alt"}">
|
||||
<td>
|
||||
<a title="View details" href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
<a title="View details" href="{$smarty.const.WWW_TOP}/series/{$show.id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.releasetitle|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
</td>
|
||||
<td class="less">{if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if}</td>
|
||||
<td class="less" title="Added on {$show.createddate}">{$show.createddate|date_format}</td>
|
||||
<td class="mid"><a href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.videos_id}" class="myshows" rel="edit" name="series{$show.videos_id}" title="Edit Categories">Edit</a> <a href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.videos_id}" class="myshows" rel="remove" name="series{$show.videos_id}" title="Remove from My Shows">Remove</a></td>
|
||||
<td class="mid"><a href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.id}" class="myshows" rel="edit" name="series{$show.id}" title="Edit Categories">Edit</a> <a href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.id}" class="myshows" rel="remove" name="series{$show.id}" title="Remove from My Shows">Remove</a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<a title="View details"
|
||||
href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
href="{$smarty.const.WWW_TOP}/series/{$show.id}{if $show.categoryid != ''}?t={$show.categoryid|replace:"|":","}{/if}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-default">{if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if}</span>
|
||||
@@ -43,11 +43,11 @@
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-xs btn-warning myshows"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.videos_id}"
|
||||
rel="edit" name="series{$show.videos_id}" title="Edit Categories">Edit</a>
|
||||
href="{$smarty.const.WWW_TOP}/myshows/edit/{$show.id}"
|
||||
rel="edit" name="series{$show.id}" title="Edit Categories">Edit</a>
|
||||
<a class="btn btn-xs btn-danger confirm_action myshows"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.videos_id}"
|
||||
rel="remove" name="series{$show.videos_id}"
|
||||
href="{$smarty.const.WWW_TOP}/myshows/delete/{$show.id}"
|
||||
rel="remove" name="series{$show.id}"
|
||||
title="Remove from My Shows">Remove</a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -38,15 +38,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="videosID">Video Id:</label></td>
|
||||
<td><label for="videosid">Video Id:</label></td>
|
||||
<td>
|
||||
<input id="videosID" class="short" name="videosID" type="text" value="{$release.videos_id}" />
|
||||
<input id="videosid" class="short" name="videosid" type="text" value="{$release.videos_id}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="episodeID">TV Episode Id:</label></td>
|
||||
<td><label for="episodeid">TV Episode Id:</label></td>
|
||||
<td>
|
||||
<input id="episodeID" class="short" name="episodeID" type="text" value="{$release.tv_episodes_id}" />
|
||||
<input id="episodeid" class="short" name="episodeid" type="text" value="{$release.tv_episodes_id}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user