From a5041cc78ae516e6035e02a9b63fd5aae5b5f080 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 21 Oct 2015 15:56:59 +0200 Subject: [PATCH] First batch of template changes to accomodate new tv processing --- Changelog | 1 + newznab/processing/post/AniDB.php | 52 ++--- newznab/processing/post/ProcessAdditional.php | 4 - .../post/ProcessAdditionalException.php | 26 +++ .../charisma/templates/frontend/viewnzb.tpl | 66 +++---- .../templates/frontend/viewserieslist.tpl | 6 +- .../omicron/templates/frontend/viewnzb.tpl | 66 +++---- .../templates/frontend/viewserieslist.tpl | 6 +- .../templates/admin/ajax_release-edit.tpl | 177 +++++++----------- 9 files changed, 180 insertions(+), 224 deletions(-) mode change 100644 => 100755 newznab/processing/post/AniDB.php create mode 100644 newznab/processing/post/ProcessAdditionalException.php diff --git a/Changelog b/Changelog index 855139a3f..6370d2ddd 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2015-10-21 DariusIII + Fix: First batch of changes to charisma/omicron templates to accommodate tv changes Fix: Properly fix trakt in Movie.php Fix: Fix TraktTv related errors Fix: Rename release_files to releasefiles diff --git a/newznab/processing/post/AniDB.php b/newznab/processing/post/AniDB.php old mode 100644 new mode 100755 index 55ed01c71..57dcd39a7 --- a/newznab/processing/post/AniDB.php +++ b/newznab/processing/post/AniDB.php @@ -1,14 +1,15 @@ false, @@ -199,7 +200,7 @@ class AniDB * * @return bool */ - private function matchAnimeRelease($release = []) + private function matchAnimeRelease($release = array()) { $matched = false; $type = 'Local'; @@ -233,19 +234,15 @@ class AniDB $type = 'Remote'; } else { echo PHP_EOL . - $this->pdo->log->info("This AniDB id was not found to be accurate locally, but has been updated too recently to check AniDB.") . + $this->pdo->log->info("This AniDB ID was not found to be accurate locally, but has been updated too recently to check AniDB.") . PHP_EOL; } } - $this->updateRelease($anidbId['anidbid'], - $cleanArr['epno'], - $updatedAni['episode_title'], - $updatedAni['airdate'], - $release['id']); + $this->updateRelease($anidbId['anidbid'], $release['id']); $this->pdo->log->doEcho( - $this->pdo->log->headerOver("Matched {$type} AniDB id: ") . + $this->pdo->log->headerOver("Matched {$type} AniDB ID: ") . $this->pdo->log->primary($anidbId['anidbid']) . $this->pdo->log->alternateOver(" Title: ") . $this->pdo->log->primary($anidbId['title']) . @@ -269,32 +266,17 @@ class AniDB } /** - * Updates releases based on matched Anime info - * - * @param int $anidbId - * @param int $epno - * @param string $title - * @param string $airdate - * @param int $relId - * - * @return array|bool + * @param $anidbId + * @param $relId */ - private function updateRelease($anidbId, $epno, $title, $airdate, $relId) + private function updateRelease($anidbId, $relId) { - - $epno = 'E' . ($epno < 10 ? '0' : '') . $epno; - $this->pdo->queryExec( sprintf(" UPDATE releases - SET anidbid = %d, seriesfull = %s, season = 'S01', episode = %s, - tvtitle = %s, tvairdate = %s + SET anidbid = %d WHERE id = %d", $anidbId, - $this->pdo->escapeString('S01' . $epno), - $this->pdo->escapeString($epno), - $this->pdo->escapeString($title), - $this->pdo->escapeString($airdate), $relId ) ); @@ -310,13 +292,13 @@ class AniDB private function updateTimeCheck($anidbId) { return $this->pdo->queryOneRow( - sprintf(" + sprintf(" SELECT anidbid FROM anidb_info ai WHERE DATEDIFF(NOW(), ai.updated) < 7 AND ai.anidbid = %d", - $anidbId - ) + $anidbId + ) ); } } diff --git a/newznab/processing/post/ProcessAdditional.php b/newznab/processing/post/ProcessAdditional.php index 5718b6fed..64c20e1d4 100644 --- a/newznab/processing/post/ProcessAdditional.php +++ b/newznab/processing/post/ProcessAdditional.php @@ -2587,7 +2587,3 @@ class ProcessAdditional } } } - -class ProcessAdditionalException extends \Exception -{ -} diff --git a/newznab/processing/post/ProcessAdditionalException.php b/newznab/processing/post/ProcessAdditionalException.php new file mode 100644 index 000000000..dd57320a1 --- /dev/null +++ b/newznab/processing/post/ProcessAdditionalException.php @@ -0,0 +1,26 @@ +. + * @author niel + * @copyright 2015 nZEDb + */ +namespace newznab\processing\post; + + +class ProcessAdditionalException extends \Exception +{ +} diff --git a/www/themes/charisma/templates/frontend/viewnzb.tpl b/www/themes/charisma/templates/frontend/viewnzb.tpl index d029195a0..65aa70f6a 100644 --- a/www/themes/charisma/templates/frontend/viewnzb.tpl +++ b/www/themes/charisma/templates/frontend/viewnzb.tpl @@ -46,13 +46,13 @@ href="{$smarty.const.WWW_TOP}/rss?anidb={$release.anidbid}&dl=1&i={$userdata.id}&r={$userdata.rsstoken}">Anime RSS Feed {/if} - {if $rage && $release.rageid > 0} - 0} + Add to My Shows - View all episodes TV Rage {if $release.tvdbid > 0} - {if $movie && $release.rageid < 0 && $movie.plot != ''}{$movie.plot|escape:"htmlall"|truncate:500:"...":true} {if $movie.plot|strlen > 500} more... {$movie.plot|escape:"htmlall"|nl2br|magicurl}{/if}{/if} - {if $rage && $release.rageid > 0 && $rage.description != ""}{$rage.description|escape:"htmlall"|nl2br|magicurl|truncate:500:"...":true} - {if $rage.description|strlen > 500} + {if $show && $release.videos_id > 0 && $show.summary != ""}{$show.summary|escape:"htmlall"|nl2br|magicurl|truncate:500:"...":true} + {if $show.summary|strlen > 500} more... - {$rage.description|escape:"htmlall"|nl2br|magicurl}{/if}{/if} + {$show.summary|escape:"htmlall"|nl2br|magicurl}{/if}{/if} {if $xxx} {if $xxx.tagline != ''}
{$xxx.tagline|stripslashes|escape:"htmlall"}{/if} {if $xxx.plot != ''}{if $xxx.tagline != ''} - {else} @@ -109,7 +109,7 @@