mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update Movie class and remove getTraktData script from tmux loop
This commit is contained in:
+13
-13
@@ -612,53 +612,53 @@ class Movie
|
||||
}
|
||||
|
||||
// Check TMDB for IMDB info.
|
||||
$tmdb = $this->fetchTMDBProperties($imdbId);
|
||||
$tmdb = $this->fetchTMDBProperties(str_pad($imdbId, 7, '0', STR_PAD_LEFT));
|
||||
|
||||
// Check IMDB for movie info.
|
||||
$imdb = $this->fetchIMDBProperties($imdbId);
|
||||
$imdb = $this->fetchIMDBProperties(str_pad($imdbId, 7, '0', STR_PAD_LEFT));
|
||||
|
||||
// Check TRAKT for movie info
|
||||
$trakt = $this->fetchTraktTVProperties($imdbId);
|
||||
$trakt = $this->fetchTraktTVProperties(str_pad($imdbId, 7, '0', STR_PAD_LEFT));
|
||||
|
||||
// Check OMDb for movie info
|
||||
$omdb = $this->fetchOmdbAPIProperties($imdbId);
|
||||
$omdb = $this->fetchOmdbAPIProperties(str_pad($imdbId, 7, '0', STR_PAD_LEFT));
|
||||
if (! $imdb && ! $tmdb && ! $trakt && ! $omdb) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check FanArt.tv for cover and background images.
|
||||
$fanart = $this->fetchFanartTVProperties($imdbId);
|
||||
$fanart = $this->fetchFanartTVProperties(str_pad($imdbId, 7, '0', STR_PAD_LEFT));
|
||||
|
||||
$mov = [];
|
||||
|
||||
$mov['cover'] = $mov['backdrop'] = $mov['banner'] = 0;
|
||||
$mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = '';
|
||||
|
||||
$mov['imdbid'] = $imdbId;
|
||||
$mov['imdbid'] = str_pad($imdbId, 7, '0', STR_PAD_LEFT);
|
||||
$mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid'];
|
||||
$mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id'];
|
||||
|
||||
// Prefer Fanart.tv cover over TMDB,TMDB over IMDB and IMDB over OMDB.
|
||||
if (! empty($fanart['cover'])) {
|
||||
$mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath);
|
||||
$mov['cover'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-cover', $fanart['cover'], $this->imgSavePath);
|
||||
} elseif (! empty($tmdb['cover'])) {
|
||||
$mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath);
|
||||
$mov['cover'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-cover', $tmdb['cover'], $this->imgSavePath);
|
||||
} elseif (! empty($imdb['cover'])) {
|
||||
$mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath);
|
||||
$mov['cover'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-cover', $imdb['cover'], $this->imgSavePath);
|
||||
} elseif (! empty($omdb['cover'])) {
|
||||
$mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath);
|
||||
$mov['cover'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-cover', $omdb['cover'], $this->imgSavePath);
|
||||
}
|
||||
|
||||
// Backdrops.
|
||||
if (! empty($fanart['backdrop'])) {
|
||||
$mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024);
|
||||
$mov['backdrop'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024);
|
||||
} elseif (! empty($tmdb['backdrop'])) {
|
||||
$mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024);
|
||||
$mov['backdrop'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024);
|
||||
}
|
||||
|
||||
// Banner
|
||||
if (! empty($fanart['banner'])) {
|
||||
$mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath);
|
||||
$mov['banner'] = $this->releaseImage->saveImage(str_pad($imdbId, 7, '0', STR_PAD_LEFT).'-banner', $fanart['banner'], $this->imgSavePath);
|
||||
}
|
||||
|
||||
// RottenTomatoes rating from OmdbAPI
|
||||
|
||||
@@ -311,7 +311,6 @@ class TmuxRun extends Tmux
|
||||
{$runVar['commands']['_php']} {$runVar['paths']['misc']}update/multiprocessing/postprocess.php mov $log; \
|
||||
{$runVar['commands']['_php']} {$runVar['paths']['misc']}update/postprocess.php anime true $log; \
|
||||
{$runVar['commands']['_php']} {$runVar['paths']['misc']}testing/PostProc/check_covers.php true $log; \
|
||||
{$runVar['commands']['_php']} {$runVar['paths']['misc']}testing/PostProc/getTraktData.php $log; \
|
||||
date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['post_timer_non']}' 2>&1 1> /dev/null"
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
2018-08-10 DariusIII
|
||||
* Chg: Update Movie class and remove getTraktData script from tmux loop
|
||||
* Chg: Add ssl options to stream_context_create in saveImage function
|
||||
* Chg: Change handling of TVDB poster image downloads, try to fix authorization to url
|
||||
* Chg: Use less greedy parts of regexes and fix PHPDOC blocks for $release variable in functions in NameFixer class
|
||||
|
||||
@@ -15,7 +15,6 @@ $count = $movies->count();
|
||||
if ($count > 0) {
|
||||
echo ColorCLI::primary('Updating '.number_format($count).' movies for TraktTV id.');
|
||||
foreach ($movies as $mov) {
|
||||
$startTime = microtime(true);
|
||||
$traktTv = new TraktTv(['Settings' => null]);
|
||||
$traktmovie = $traktTv->client->movieSummary('tt'.str_pad($mov['imdbid'], 7, '0', STR_PAD_LEFT), 'full');
|
||||
if ($traktmovie !== false) {
|
||||
|
||||
Reference in New Issue
Block a user