protected function updateEntryThumbnail() { if ($this->getEntryStatus() != entryStatus::READY || !strlen($this->getThumbnailUrl()) || $this->getThumbnailSaved()) { return; } try { $entry = entryPeer::retrieveByPKNoFilter($this->getObjectId()); myEntryUtils::updateThumbnailFromFile($entry, $this->getThumbnailUrl()); } catch (Exception $e) { KalturaLog::err($e->getMessage()); return; } $this->setThumbnailSaved(true); }
protected function updateThumbnailJpegForEntry($entryId, $fileData, $entryType = null, $fileSyncType = entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB) { $dbEntry = entryPeer::retrieveByPK($entryId); if (!$dbEntry || $entryType !== null && $dbEntry->getType() != $entryType) { throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId); } // if session is not admin, we should check that the user that is updating the thumbnail is the one created the entry // FIXME: Temporary disabled because update thumbnail feature (in app studio) is working with anonymous ks /*if (!$this->getKs()->isAdmin()) { if ($dbEntry->getPuserId() !== $this->getKs()->user) { throw new KalturaAPIException(KalturaErrors::PERMISSION_DENIED_TO_UPDATE_ENTRY); } }*/ myEntryUtils::updateThumbnailFromFile($dbEntry, $fileData["tmp_name"], $fileSyncType); $entry = KalturaEntryFactory::getInstanceByType($dbEntry->getType()); $entry->fromObject($dbEntry, $this->getResponseProfile()); return $entry; }
protected function updateEntryThumbnail(BulkUploadResult $bulkUploadResult) { if ($bulkUploadResult->getEntryStatus() != entryStatus::READY || !strlen($bulkUploadResult->getThumbnailUrl()) || $bulkUploadResult->getThumbnailSaved()) { return; } myEntryUtils::updateThumbnailFromFile($bulkUploadResult->getEntry(), $bulkUploadResult->getThumbnailUrl()); $bulkUploadResult->setThumbnailSaved(true); $bulkUploadResult->save(); }