private static function updateRoughcutEntry($roughcut_id, $roughcut_version, $roughcut_kshow_id, $entry_id, $op_type)
 {
     $roughcut_entry = new roughcutEntry();
     $roughcut_entry->setRoughcutId($roughcut_id);
     $roughcut_entry->setRoughcutVersion($roughcut_version);
     $roughcut_entry->setRoughcutKshowId($roughcut_kshow_id);
     $roughcut_entry->setEntryId($entry_id);
     $roughcut_entry->setOpType($op_type);
     $roughcut_entry->save();
 }
Пример #2
0
 public function getRoughcuts()
 {
     return roughcutEntry::getAllRoughcuts($this->getId());
 }
Пример #3
0
 public static function setMetadata($content, $kshow, $show_entry, $ignore_current = false, $version_info = null)
 {
     $xml_content = "";
     $show_entry_data_key = $show_entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
     $current_content = $show_entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_SHOW ? "" : kFileSyncUtils::file_get_contents($show_entry_data_key);
     if ($ignore_current) {
         $current_content = "";
     }
     $update_kshow = false;
     // compare the content and store only if different
     if ($content != $current_content) {
         $show_entry->setData("metadata.xml");
         // re-create data key (to get latest version)
         $show_entry_data_key = $show_entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
         //$version = myContentStorage::getVersion($file_name);
         //$comments = "file path: " . $file_name . "\n";
         $comments = "version: " . $show_entry_data_key->version . "\n";
         $total_duration = 0;
         $editor_type = null;
         $content = myFlvStreamer::fixMetadata($content, $show_entry_data_key->version, $total_duration, $editor_type);
         // TODO - make fixMetadata a more generic funciton to return the editorType as well
         // save info file about the version
         if (isset($version_info)) {
             $content = self::addVersionInfo($content, $version_info);
         }
         //fixme $content = myFlvStreamer::modifiedByKeditor ( $content );
         // total_duration is in seconds with 2 digits after the decimal point
         $show_entry->setLengthInMsecs($total_duration * 1000);
         $show_entry->setMediaType(entry::ENTRY_MEDIA_TYPE_SHOW);
         $show_entry->setEditorType($editor_type);
         $show_entry->setModifiedAt(time());
         // update the modified_at date
         $show_entry->save();
         kFileSyncUtils::file_put_contents($show_entry_data_key, $content, true);
         $xml_content = kFileSyncUtils::file_get_contents($show_entry_data_key);
         // replaced__getFileContent
         $update_kshow = true;
         $show_entry_id = $show_entry->getId();
         // update the roughcut_entry table
         $all_entries_for_roughcut = self::getAllEntries($content);
         roughcutEntry::updateRoughcut($show_entry->getId(), $show_entry->getVersion(), $show_entry->getKshowId(), $all_entries_for_roughcut);
         $xml_content = $content;
     } else {
         $xml_content = $current_content;
         $comments = "old and new files are the same";
     }
     if (!$kshow->getHasRoughcut() && $kshow->getIntroId() != $show_entry->getId()) {
         $kshow->setHasRoughcut(true);
         $update_kshow = true;
     }
     myStatisticsMgr::incKshowUpdates($kshow);
     $kshow->save();
     return array($xml_content, $comments, $update_kshow);
 }
Пример #4
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      roughcutEntry $value A roughcutEntry object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(roughcutEntry $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         if (isset(self::$instances[$key]) || count(self::$instances) < kConf::get('max_num_instances_in_pool')) {
             self::$instances[$key] = $obj;
             kMemoryManager::registerPeer('roughcutEntryPeer');
         }
     }
 }
Пример #5
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      roughcutEntry $value A roughcutEntry object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(roughcutEntry $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
 /**
  * Get the mixes in which the media entry is included
  *
  * @action getMixesByMediaId
  * @param string $mediaEntryId
  * @return KalturaMixEntryArray
  */
 public function getMixesByMediaIdAction($mediaEntryId)
 {
     $dbMediaEntry = entryPeer::retrieveByPK($mediaEntryId);
     if (!$dbMediaEntry || $dbMediaEntry->getType() != KalturaEntryType::MEDIA_CLIP) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $mediaEntryId);
     }
     $list = roughcutEntry::getAllRoughcuts($mediaEntryId);
     $newList = KalturaMixEntryArray::fromEntryArray($list);
     return $newList;
 }