protected function execute(InputInterface $input, OutputInterface $output) { $show = new Show(); $show->setName($input->getArgument('show')); $episode = Episode::fromString($input->getArgument('episode')); $magnet = $this->trackerClient->lookupTorrentMagnetUrl($show, $episode); if (!$magnet) { $output->writeln("Nothing found"); } else { $output->writeln("Found: {$magnet}\n"); } }
/** * @param $name * @param $lastEpisode * @return Show */ public static function create($name, $lastEpisode) { return (new self())->setName($name)->setLastEpisode(Episode::fromString($lastEpisode)); }