mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
Add list of failed releases to admin area.
(cherry picked from commit fa130d2)
This commit is contained in:
@@ -42,6 +42,38 @@ class DnzbFailures
|
||||
return $result[0]['num'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a count of failed releases for pager. used in admin manage failed releases list
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
|
||||
$res = $this->pdo->queryOneRow("SELECT count(id) AS num FROM dnzb_failures");
|
||||
|
||||
return $res["num"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a range of releases. used in admin manage list
|
||||
*/
|
||||
public function getFailedRange($start, $num)
|
||||
{
|
||||
|
||||
|
||||
if ($start === false)
|
||||
$limit = "";
|
||||
else
|
||||
$limit = " LIMIT " . $start . "," . $num;
|
||||
|
||||
return $this->pdo->query("SELECT r.*, df.guid, concat(cp.title, ' > ', c.title) AS category_name
|
||||
FROM releases r
|
||||
RIGHT JOIN dnzb_failures df ON df.guid = r.guid
|
||||
LEFT OUTER JOIN category c ON c.id = r.categoryid
|
||||
LEFT OUTER JOIN category cp ON cp.id = c.parentid
|
||||
ORDER BY postdate DESC" . $limit
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve alternate release with same or similar searchname
|
||||
*
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require_once("config.php");
|
||||
|
||||
$page = new AdminPage();
|
||||
|
||||
$failed = new DnzbFailures(['Settings' => $page->settings]);
|
||||
|
||||
$page->title = "Failed Releases List";
|
||||
|
||||
$frelcount = $failed->getCount();
|
||||
|
||||
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
|
||||
$page->smarty->assign('pagertotalitems',$frelcount);
|
||||
$page->smarty->assign('pageroffset',$offset);
|
||||
$page->smarty->assign('pageritemsperpage',ITEMS_PER_PAGE);
|
||||
$page->smarty->assign('pagerquerybase', WWW_TOP."/failrel-list.php?offset=");
|
||||
$pager = $page->smarty->fetch("pager.tpl");
|
||||
$page->smarty->assign('pager', $pager);
|
||||
|
||||
$frellist = $failed->getFailedRange($offset, ITEMS_PER_PAGE);
|
||||
$page->smarty->assign('releaselist', $frellist);
|
||||
|
||||
$page->content = $page->smarty->fetch('failrel-list.tpl');
|
||||
$page->render();
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
</li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/binaryblacklist-list.php">View</a> <a style="padding:0;" href="{$smarty.const.WWW_TOP}/binaryblacklist-edit.php?action=add">Add</a> Blacklist</li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/release-list.php">View Releases</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/failrel-list.php">View Failed Releases</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/preview-list.php">View Previews</a></li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/rage-list.php">View</a> <a style="padding:0;" href="{$smarty.const.WWW_TOP}/rage-edit.php?action=add">Add</a> TVRage List</li>
|
||||
<li><a href="{$smarty.const.WWW_TOP}/thetvdb-list.php">View TheTVDB List</a></li>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<h1>{$page->title}</h1>
|
||||
|
||||
{if $releaselist}
|
||||
{$pager}
|
||||
|
||||
<table style="margin-top:10px;" class="data Sortable highlight">
|
||||
|
||||
<tr>
|
||||
<th>name</th>
|
||||
<th>category</th>
|
||||
<th>size</th>
|
||||
<th>files</th>
|
||||
<th>postdate</th>
|
||||
<th>adddate</th>
|
||||
<th>grabs</th>
|
||||
<th>options</th>
|
||||
</tr>
|
||||
|
||||
{foreach from=$releaselist item=release}
|
||||
<tr class="{cycle values=",alt"}">
|
||||
<td title="{$release.name}"><a href="{$smarty.const.WWW_TOP}/release-edit.php?id={$release.id}">{$release.searchname|escape:"htmlall"|wordwrap:75:"\n":true}</a></td>
|
||||
<td class="less">{$release.category_name}</td>
|
||||
<td class="less right">{$release.size|fsize_format:"MB"}</td>
|
||||
<td class="less mid"><a href="release-files.php?id={$release.guid}">{$release.totalpart}</a></td>
|
||||
<td class="less">{$release.postdate|date_format}</td>
|
||||
<td class="less">{$release.adddate|date_format}</td>
|
||||
<td class="less mid">{$release.grabs}</td>
|
||||
<td><a href="{$smarty.const.WWW_TOP}/release-delete.php?id={$release.id}">delete</a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</table>
|
||||
<br/>
|
||||
{$pager}
|
||||
{else}
|
||||
<p>No releases available.</p>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user