diff --git a/Changelog b/Changelog index 972dd4138..79e72a2e8 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-04-23 DariusIII + * Chg: Update series page range and category handling * Chg: Use query builder for tvSearch * Chg: Remove static admin from .htaccess * Chg: Update BrowseController and themes browse pages diff --git a/app/Http/Controllers/SeriesController.php b/app/Http/Controllers/SeriesController.php index 6fe9ab89c..4ddb0a6c8 100644 --- a/app/Http/Controllers/SeriesController.php +++ b/app/Http/Controllers/SeriesController.php @@ -11,16 +11,17 @@ use Illuminate\Support\Facades\Auth; class SeriesController extends BasePageController { /** + * @param string $id * @param \Illuminate\Http\Request $request * * @throws \Exception */ - public function index(Request $request) + public function index($id = '', Request $request) { $this->setPrefs(); $releases = new Releases(['Settings' => $this->settings]); - if ($request->has('id') && ctype_digit($request->input('id'))) { + if ($id && ctype_digit($id)) { $category = -1; if ($request->has('t') && ctype_digit($request->input('t'))) { $category = $request->input('t'); @@ -31,7 +32,7 @@ class SeriesController extends BasePageController $page = $request->has('page') ? $request->input('page') : 1; - $rel = $releases->tvSearch($page, ['id' => $request->input('id')], '', '', '', 1000, '', $catarray, -1); + $rel = $releases->tvSearch($page, ['id' => $id], '', '', '', 1000, '', $catarray, -1); $show = Video::getByVideoID($request->input('id')); if (! $show) { @@ -99,11 +100,11 @@ class SeriesController extends BasePageController ]); $this->pagerender(); } else { - $letter = ($request->has('id') && preg_match('/^(0\-9|[A-Z])$/i', $request->input('id'))) ? $request->input('id') : '0-9'; + $letter = ($id && preg_match('/^(0\-9|[A-Z])$/i', $id)) ? $id : '0-9'; $showname = ($request->has('title') && ! empty($request->input('title'))) ? $request->input('title') : ''; - if ($showname !== '' && ! $request->has('id')) { + if ($showname !== '' && ! $id) { $letter = ''; } diff --git a/resources/views/themes/Charisma/browse.tpl b/resources/views/themes/Charisma/browse.tpl index 47f9de9ad..822560d0c 100755 --- a/resources/views/themes/Charisma/browse.tpl +++ b/resources/views/themes/Charisma/browse.tpl @@ -113,7 +113,7 @@ name="name{$result.guid}" class="modal_prev label label-default" rel="preview">Preview{/if} {if $result.videos_id > 0}View TV + href="{$smarty.const.WWW_TOP}/series/{$result.videos_id}">View TV {/if} {if isset($result.firstaired) && $result.firstaired != ""} diff --git a/resources/views/themes/Charisma/myshows.tpl b/resources/views/themes/Charisma/myshows.tpl index af7858368..fa5371c4b 100755 --- a/resources/views/themes/Charisma/myshows.tpl +++ b/resources/views/themes/Charisma/myshows.tpl @@ -34,7 +34,7 @@ {$show.title|escape:"htmlall"|wordwrap:75:"\n":true} + href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} diff --git a/resources/views/themes/Charisma/search.tpl b/resources/views/themes/Charisma/search.tpl index 869f0c682..30765a888 100755 --- a/resources/views/themes/Charisma/search.tpl +++ b/resources/views/themes/Charisma/search.tpl @@ -270,7 +270,7 @@ {/if} {if $result.videos_id > 0} View + href="{$smarty.const.WWW_TOP}/series/{$result.videos_id}" title="View all episodes">View Series {/if} {if $result.anidbid > 0} diff --git a/resources/views/themes/Charisma/viewnzb.tpl b/resources/views/themes/Charisma/viewnzb.tpl index cffc3a266..6198989fb 100755 --- a/resources/views/themes/Charisma/viewnzb.tpl +++ b/resources/views/themes/Charisma/viewnzb.tpl @@ -52,7 +52,7 @@ {if $show && $release.videos_id > 0} Add to My Shows - View all episodes {if $show.tvdb > 0}

Jump to: -  [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} +  [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} {foreach $seriesrange as $range} - {if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} + {if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} {/foreach}]

@@ -53,7 +53,7 @@ {foreach $series as $s} - {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} + {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} {$s.countries_id|escape:"htmlall"} {if $s.userseriesid != null} @@ -65,7 +65,7 @@ {/if} - Series
+ Series
{if $s.id > 0} {if $s.tvdb > 0} TVDB diff --git a/resources/views/themes/Gamma/browse.tpl b/resources/views/themes/Gamma/browse.tpl index 21ca2e17f..69b6c008a 100755 --- a/resources/views/themes/Gamma/browse.tpl +++ b/resources/views/themes/Gamma/browse.tpl @@ -143,7 +143,7 @@ Cover {/if} {if $result.videos_id > 0} - View Series + View Series {/if} {if $result.anidbid > 0} View Anime diff --git a/resources/views/themes/Gamma/myshows.tpl b/resources/views/themes/Gamma/myshows.tpl index f399ab440..0cb0293cb 100755 --- a/resources/views/themes/Gamma/myshows.tpl +++ b/resources/views/themes/Gamma/myshows.tpl @@ -18,7 +18,7 @@ {foreach $shows as $show} -
{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}
+
{$show.title|escape:"htmlall"|wordwrap:75:"\n":true}
{if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} {$show.created_at|date_format} diff --git a/resources/views/themes/Gamma/search.tpl b/resources/views/themes/Gamma/search.tpl index cd76f92be..ab589849b 100755 --- a/resources/views/themes/Gamma/search.tpl +++ b/resources/views/themes/Gamma/search.tpl @@ -229,7 +229,7 @@ Cover {/if} {if $result.videos_id > 0} - View Series + View Series {/if} {if $result.anidbid > 0} View Anime diff --git a/resources/views/themes/Gamma/viewnzb.tpl b/resources/views/themes/Gamma/viewnzb.tpl index b468e9af0..f5629c189 100755 --- a/resources/views/themes/Gamma/viewnzb.tpl +++ b/resources/views/themes/Gamma/viewnzb.tpl @@ -69,7 +69,7 @@ {/if}
- All Episodes + All Episodes {if $show.trakt > 0}Trakt{/if} {if $show.tvdb > 0}TheTVDB{/if}
diff --git a/resources/views/themes/Gamma/viewseries.tpl b/resources/views/themes/Gamma/viewseries.tpl index 124e7f75c..1657f796b 100755 --- a/resources/views/themes/Gamma/viewseries.tpl +++ b/resources/views/themes/Gamma/viewseries.tpl @@ -201,7 +201,7 @@
- {$result.category_name} + {$result.category_name} {$result.postdate|timeago} diff --git a/resources/views/themes/Gamma/viewserieslist.tpl b/resources/views/themes/Gamma/viewserieslist.tpl index 06beaf565..59992cd1a 100755 --- a/resources/views/themes/Gamma/viewserieslist.tpl +++ b/resources/views/themes/Gamma/viewserieslist.tpl @@ -4,9 +4,9 @@

Jump to: - [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} + [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} {foreach $seriesrange as $range} -{if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} +{if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} {/foreach}]

@@ -46,7 +46,7 @@ {foreach $series as $s} - {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} + {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} {$s.publisher|escape:"htmlall"} {$s.countries_id|escape:"htmlall"} @@ -60,7 +60,7 @@ {/if} - Series
+ Series
{if $s.id > 0} {if $s.tvdb > 0} TVDB diff --git a/resources/views/themes/Gentele/browse.tpl b/resources/views/themes/Gentele/browse.tpl index 6da3a2732..f14dee96b 100755 --- a/resources/views/themes/Gentele/browse.tpl +++ b/resources/views/themes/Gentele/browse.tpl @@ -125,7 +125,7 @@ class="label label-primary" rel="preview">Preview{/if} {if $result.videos_id > 0}View TV {/if} {if !empty($result.firstaired)} {$show.title|escape:"htmlall"|wordwrap:75:"\n":true} + href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} diff --git a/resources/views/themes/Gentele/search.tpl b/resources/views/themes/Gentele/search.tpl index 5d69e0b54..4fac6e453 100755 --- a/resources/views/themes/Gentele/search.tpl +++ b/resources/views/themes/Gentele/search.tpl @@ -296,7 +296,7 @@ {/if} {if $result.videos_id > 0} View Series {/if} diff --git a/resources/views/themes/Gentele/viewnzb.tpl b/resources/views/themes/Gentele/viewnzb.tpl index f0c4787e0..71aa49565 100755 --- a/resources/views/themes/Gentele/viewnzb.tpl +++ b/resources/views/themes/Gentele/viewnzb.tpl @@ -58,7 +58,7 @@ {if $show && $release.videos_id > 0} Add to My Shows - View all episodes {if $show.tvdb > 0} Jump to:  [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} + href="{$smarty.const.WWW_TOP}/series/0-9">0-9{if $seriesletter == '0-9'}{/if} {foreach $seriesrange as $range} {if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} + href="{$smarty.const.WWW_TOP}/series/{$range}">{$range}{if $range == $seriesletter}{/if} {/foreach}]

@@ -68,7 +68,7 @@ {foreach $series as $s} {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''} + href="{$smarty.const.WWW_TOP}/series/{$s.id}">{if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} {$s.publisher|escape:"htmlall"} @@ -89,7 +89,7 @@ {/if} - Series
+ Series
{if $s.id > 0} {if $s.tvdb > 0} Preview{/if} {if $result.videos_id > 0}View TV + href="{$smarty.const.WWW_TOP}/series/{$result.videos_id}">View TV {/if} {if isset($result.firstaired) && $result.firstaired != ""} diff --git a/resources/views/themes/Omicron/myshows.tpl b/resources/views/themes/Omicron/myshows.tpl index ba8566256..67d211886 100755 --- a/resources/views/themes/Omicron/myshows.tpl +++ b/resources/views/themes/Omicron/myshows.tpl @@ -34,7 +34,7 @@ {$show.title|escape:"htmlall"|wordwrap:75:"\n":true} + href="{$smarty.const.WWW_TOP}/series/{$show.videos_id}">{$show.title|escape:"htmlall"|wordwrap:75:"\n":true} {if $show.categoryNames != ''}{$show.categoryNames|escape:"htmlall"}{else}All{/if} diff --git a/resources/views/themes/Omicron/search.tpl b/resources/views/themes/Omicron/search.tpl index 5d69e0b54..4fac6e453 100755 --- a/resources/views/themes/Omicron/search.tpl +++ b/resources/views/themes/Omicron/search.tpl @@ -296,7 +296,7 @@ {/if} {if $result.videos_id > 0} View Series {/if} diff --git a/resources/views/themes/Omicron/viewnzb.tpl b/resources/views/themes/Omicron/viewnzb.tpl index 143863c94..b86555314 100755 --- a/resources/views/themes/Omicron/viewnzb.tpl +++ b/resources/views/themes/Omicron/viewnzb.tpl @@ -52,7 +52,7 @@ {if $show && $release.videos_id > 0} Add to My Shows - View all episodes {if $show.tvdb > 0}

Jump to: -  [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} +  [ {if $seriesletter == '0-9'}{/if}0-9{if $seriesletter == '0-9'}{/if} {foreach $seriesrange as $range} - {if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} + {if $range == $seriesletter}{/if}{$range}{if $range == $seriesletter}{/if} {/foreach}]

@@ -53,7 +53,7 @@ {foreach $series as $s} - {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} + {if !empty($s.title)}{$s.title|escape:"htmlall"}{/if}{if $s.prevdate != ''}
Last: {$s.previnfo|escape:"htmlall"} aired {$s.prevdate|date_format}{/if} {$s.publisher|escape:"htmlall"} {$s.countries_id|escape:"htmlall"} @@ -66,7 +66,7 @@ {/if} - Series
+ Series
{if $s.id > 0} {if $s.tvdb > 0} TVDB diff --git a/routes/web.php b/routes/web.php index 470975296..cda312281 100644 --- a/routes/web.php +++ b/routes/web.php @@ -198,9 +198,9 @@ Route::get('sendtocouch', 'SendReleaseController@couchPotato'); Route::post('sendtocouch', 'SendReleaseController@couchPotato'); -Route::get('series', 'SeriesController@index'); +Route::get('series/{id?}', 'SeriesController@index'); -Route::post('series', 'SeriesController@index'); +Route::post('series/{id?}', 'SeriesController@index'); Route::get('terms-and-conditions', 'TermsController@index');