/** * Clear out the image manipulation cache * @param SS_HTTPRequest $request */ public function run($request) { $updatedFiles = 0; $VimeoVideos = VimeoVideoFile::get()->filter(array('VimeoProcessingStatus' => 'finished')); foreach ($VimeoVideos as $vid) { $updatedFiles++; $vid->updateVimeoData(); sleep(5); } echo "{$updatedFiles} files have been updated."; }
/** * Clear out the image manipulation cache * @param SS_HTTPRequest $request */ public function run($request) { $processingFiles = 0; $processedFiles = 0; $VimeoVideos = VimeoVideoFile::get()->filter(array('VimeoProcessingStatus' => 'processing')); foreach ($VimeoVideos as $vid) { $processingFiles++; if ($vid->IsProcessed()) { $processedFiles++; } sleep(5); } echo "{$processedFiles} of {$processingFiles} processing files are now processed."; }
/** * Clear out the image manipulation cache * @param SS_HTTPRequest $request */ public function run($request) { $failedFiles = 0; $Videos = VimeoVideoFile::get()->filter(array('VimeoProcessingStatus' => array('error', 'processingerror')))->sort('ID'); foreach ($Videos as $vid) { $failedFiles++; if ($vid->ProcessingStatus == 'error') { $vid->ProcessingStatus = 'new'; } $vid->VimeoProcessingStatus = 'unprocessed'; $vid->write(); $vid->onAfterLoad(); sleep(5); } echo "{$failedFiles} failed VimeoVideoFile objects have reinitiated the processing."; }