mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Move TraaktTV into services
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use Blacklight\processing\tv\TraktTv;
|
||||
use App\Services\TraktService;
|
||||
|
||||
$c = new Blacklight\ColorCLI;
|
||||
$trakt = new TraktTv;
|
||||
$trakt = new TraktService;
|
||||
|
||||
if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
|
||||
// Test if your Trakt API key and configuration are working
|
||||
// If it works you should get a printed array of the show/season/episode entered
|
||||
|
||||
// Search for a show
|
||||
$series = $trakt->client->showSearch((string) $argv[1], 'show');
|
||||
$series = $trakt->searchShows((string) $argv[1], 'show');
|
||||
|
||||
// Use the first show found (highest match) and get the requested season/episode from $argv
|
||||
if (is_array($series)) {
|
||||
$series = $trakt->client->showSummary($series[0]['show']['ids']['trakt'], 'full,images');
|
||||
$episode = $trakt->client->episodeSummary($series['ids']['trakt'], (int) $argv[2], (int) $argv[3], 'full');
|
||||
$series = $trakt->getShowSummary($series[0]['show']['ids']['trakt'], 'full');
|
||||
$episode = $trakt->getEpisodeSummary($series['ids']['trakt'], (int) $argv[2], (int) $argv[3], 'full');
|
||||
|
||||
print_r($series);
|
||||
print_r($episode);
|
||||
|
||||
Reference in New Issue
Block a user