/** * * Allows to create additional files in the conversion process in addition to flavor asset */ private static function handleAdditionalFilesConvertFinished(flavorAsset $flavorAsset, BatchJob $dbBatchJob, kConvertJobData $data) { if (!$flavorAsset->getVersion() || !kFileSyncUtils::fileSync_exists($flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET))) { $flavorAsset->incrementVersion(); $flavorAsset->save(); } foreach ($data->getExtraDestFileSyncs() as $destFileSyncDesc) { $syncKey = $flavorAsset->getSyncKey($destFileSyncDesc->getFileSyncObjectSubType()); $flavorParamsOutput = $data->getFlavorParamsOutput(); $storageProfileId = $flavorParamsOutput->getSourceRemoteStorageProfileId(); if ($storageProfileId == StorageProfile::STORAGE_KALTURA_DC) { kFileSyncUtils::moveFromFile($destFileSyncDesc->getFileSyncLocalPath(), $syncKey, false); } elseif ($flavorParamsOutput->getRemoteStorageProfileIds()) { $remoteStorageProfileIds = explode(',', $flavorParamsOutput->getRemoteStorageProfileIds()); foreach ($remoteStorageProfileIds as $remoteStorageProfileId) { $storageProfile = StorageProfilePeer::retrieveByPK($remoteStorageProfileId); kFileSyncUtils::createReadyExternalSyncFileForKey($syncKey, $destFileSyncDesc->getFileSyncLocalPath(), $storageProfile); } } } }