Esempio n. 1
0
 /**
  * @param FixtureEpisodeData $f
  */
 private function writeLookupFailureEpisode(FixtureEpisodeData $f)
 {
     try {
         $fileSize = $f->getFile()->getSizeHuman();
     } catch (\RuntimeException $e) {
         $fileSize = 'UNKNOWN';
     }
     $rows = [['File Path', $f->getFile()->getPathname()], ['Show Name', $f->getName()], ['Season', $f->getSeasonNumber()], ['Episode Number', $f->getEpisodeNumberStart()], ['Episode Title', $f->getTitle()], ['Air Year', $f->getYear()], ['Size', $fileSize], ['API Match', '<fg=red>FAIL</>']];
     $this->ioVerbose(function (StyleInterface $style) use($rows) {
         $style->table($rows, []);
     });
     $rows = [['File Path', $f->getFile()->getPathname()], ['Size', $fileSize], ['API Match', '<fg=red>FAIL</>']];
     $this->ioNotVerbose(function (StyleInterface $style) use($rows) {
         $style->table($rows, []);
     });
 }
Esempio n. 2
0
 /**
  * @param FixtureEpisodeData $f
  * @param \Twig_Environment  $e
  * @param string             $tplPathName
  * @param string             $tplFileName
  *
  * @return \Twig_Environment[]|mixed[][]
  */
 private function moveEpisode(FixtureEpisodeData $f, \Twig_Environment $e, $tplPathName, $tplFileName)
 {
     $e->setLoader(new \Twig_Loader_Array([$tplPathName => $this->tplPathEpisode, $tplFileName => $this->tplFileEpisode]));
     $opts = ['name' => $f->getName(), 'season' => str_pad($f->getSeasonNumber(), 2, 0, STR_PAD_LEFT), 'start' => str_pad($f->getEpisodeNumberStart(), 2, 0, STR_PAD_LEFT), 'ext' => strtolower(pathinfo($f->getFile()->getRelativePathname(), PATHINFO_EXTENSION))];
     if ($f->hasTitle()) {
         $opts['title'] = $f->getTitle();
     }
     if ($f->hasYear()) {
         $opts['year'] = $f->getYear();
     }
     return [$e, $opts];
 }