芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/midiatech/lib/XTR/UpdateEmptyVideoDurations.php
mediaFactory = $container->get('mediaFactory'); $this->moduleFactory = $container->get('moduleFactory'); return $this; } /** @inheritdoc */ public function run() { $libraryLocation = $this->config->getSetting('LIBRARY_LOCATION'); $videos = $this->mediaFactory->getByMediaType('video'); foreach ($videos as $video) { /* @var \Xibo\Entity\Media $video */ if ($video->duration == 0) { // Update $module = $this->moduleFactory->createWithMedia($video); $video->duration = $module->determineDuration($libraryLocation . $video->storedAs); $video->save(['validate' => false]); } } } }