示例#1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $episode = $input->getArgument('episode');
     $show = Show::create($name, $episode);
     $this->repo->save($show);
 }
示例#2
0
 /**
  * @param Show $show
  * @param Episode $episode
  * @param bool $recurse
  * @return bool
  */
 private function tryEpisode(Show $show, Episode $episode, $recurse = false)
 {
     $magnet = $this->tracker->lookupTorrentMagnetUrl($show, $episode);
     if (!$magnet) {
         return false;
     }
     $this->output->writeln("Found new episode {$show} > {$episode}");
     $this->magnetRepo->save($magnet);
     $show->setLastEpisode($episode);
     $this->showRepo->save($show);
     if ($recurse) {
         $this->tryEpisode($show, $episode->nextEpisode());
     }
     return true;
 }