private function deleteVideoThumbnailTmpFiles(Asset_Video_Thumbnail_Config $thumbnail)
 {
     // delete all thumbnails which are using this config
     $files = scandir(PIMCORE_TEMPORARY_DIRECTORY);
     foreach ($files as $file) {
         if (preg_match("/^video_(.*)__" . $thumbnail->getName() . "/", $file)) {
             unlink(PIMCORE_TEMPORARY_DIRECTORY . "/" . $file);
         }
     }
 }
 public function videoThumbnailAddAction()
 {
     $alreadyExist = false;
     try {
         Asset_Video_Thumbnail_Config::getByName($this->_getParam("name"));
         $alreadyExist = true;
     } catch (Exception $e) {
         $alreadyExist = false;
     }
     if (!$alreadyExist) {
         $pipe = new Asset_Video_Thumbnail_Config();
         $pipe->setName($this->_getParam("name"));
         $pipe->save();
     }
     $this->_helper->json(array("success" => !$alreadyExist, "id" => $pipe->getName()));
 }