芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/fmd/lib/Upgrade/VideoDurationStep.php
store = $store; $this->log = $log; $this->config = $config; } /** * @param \Slim\Helper\Set $container * @throws \Xibo\Exception\NotFoundException */ public function doStep($container) { /** @var MediaFactory $mediaFactory */ $mediaFactory = $container->get('mediaFactory'); /** @var ModuleFactory $moduleFactory */ $moduleFactory = $container->get('moduleFactory'); $libraryLocation = $this->config->GetSetting('LIBRARY_LOCATION'); $videos = $mediaFactory->getByMediaType('video'); foreach ($videos as $video) { /* @var \Xibo\Entity\Media $video */ if ($video->duration == 0) { // Update $module = $moduleFactory->createWithMedia($video); $video->duration = $module->determineDuration($libraryLocation . $video->storedAs); $video->save(['validate' => false]); } } } }