Пример #1
0
 /**
  * Download Episodes
  * @param $diff
  * @param $counter
  * @param $new_episodes
  */
 public function downloadEpisodes(&$diff, &$counter, $new_episodes)
 {
     $this->system->createFolderIfNotExists(SERIES_FOLDER);
     Utils::box('Downloading Series');
     foreach ($diff['series'] as $serie => $episodes) {
         $this->system->createSerieFolderIfNotExists($serie);
         foreach ($episodes as $episode) {
             if ($this->client->downloadSerieEpisode($serie, $episode) === false) {
                 $counter['failed_episode'] = $counter['failed_episode'] + 1;
             }
             Utils::write(sprintf("Current: %d of %d total. Left: %d", $counter['series']++, $new_episodes, $new_episodes - $counter['series'] + 1));
         }
     }
 }
Пример #2
0
 /**
  * run write commands
  */
 public function writeSkipFiles()
 {
     Utils::box('Creating skip files');
     $this->writeSkipSeries();
     Utils::write('Skip files for series created');
     $this->writeSkipLessons();
     Utils::write('Skip files for lesson created');
     Utils::box('Finished');
 }