Example #1
0
 /**
  * @param FixtureEpisodeData $f
  * @param Tv\Episode         $e
  * @param Tv                 $s
  */
 private function writeLookupSuccessEpisode(FixtureEpisodeData $f, Tv\Episode $e, Tv $s)
 {
     try {
         $fileSize = $f->getFile()->getSizeHuman();
     } catch (\RuntimeException $e) {
         $fileSize = 'UNKNOWN';
         $this->io()->warning(sprintf('An error occured while retrieving the file size for %s', $f->getFile()->getPathname()));
     }
     $country = '';
     $countrySet = $s->getOriginCountry();
     if ($countrySet->count() > 0) {
         $countryKey = $countrySet->getKeys()[0];
         $country = $countrySet->get($countryKey)->getIso31661();
     }
     $rows = [['Tvdb Id', $s->getId() . '/' . $e->getId()], ['File Path', $f->getFile()->getPathname()], ['Show Name', $s->getName()], ['Season', $e->getSeasonNumber()], ['Episode Number', $e->getEpisodeNumber()], ['Episode Title', $e->getName()], ['Origin Country', $country], ['Air Date', $e->getAirDate()->format('Y\\-m\\-d')], ['Size', $fileSize], ['API Match', sprintf('<fg=green>OKAY: %d/%d</>', $s->getId(), $e->getId())]];
     $this->ioVerbose(function (StyleInterface $style) use($rows) {
         $style->table($rows, []);
     });
     $rows = [['File Path', $f->getFile()->getPathname()], ['Show Name', $s->getName()], ['Season/Episode', sprintf('%d/%d', $e->getSeasonNumber(), $e->getEpisodeNumber())], ['Episode Title', $e->getName()], ['Size', $fileSize], ['API Match', sprintf('<fg=green>OKAY: %d/%d</>', $s->getId(), $e->getId())]];
     $this->ioNotVerbose(function (StyleInterface $style) use($rows) {
         $style->table($rows, []);
     });
 }