Skip to content

Commit

Permalink
Merge pull request #8220 from kaltura/master-merge-Naos-14.16.0
Browse files Browse the repository at this point in the history
Master merge naos 14.16.0
  • Loading branch information
gotlieb committed Mar 18, 2019
2 parents 99c23b9 + 85e2423 commit 3eaca59
Show file tree
Hide file tree
Showing 126 changed files with 3,675 additions and 1,152 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Naos-14.15.0
Naos-14.16.0
1 change: 1 addition & 0 deletions admin_console/configs/lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@

'Kaltura_Client_EventNotification_Enum_EventNotificationTemplateType::EMAIL' => 'Email',
'Kaltura_Client_EventNotification_Enum_EventNotificationTemplateType::HTTP' => 'HTTP',
'Kaltura_Client_EventNotification_Enum_EventNotificationTemplateType::BOOLEAN' => 'BOOLEAN',

'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::BATCH_JOB_STATUS' => 'Batch job status (Very dangerous)',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_ADDED' => 'Object added',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ protected static function validateThumbAndMediaInfo(thumbParams $thumbParams, me
$thumbParamsOutput->setScaleWidth($thumbParams->getScaleWidth());
$thumbParamsOutput->setScaleHeight($thumbParams->getScaleHeight());
$thumbParamsOutput->setBackgroundColor($thumbParams->getBackgroundColor());
$thumbParamsOutput->setInterval($thumbParams->getInterval());

if($mediaInfo && $mediaInfo->getVideoDuration())
{
Expand Down
9 changes: 8 additions & 1 deletion alpha/apps/kaltura/lib/batch2/kFlowHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1048,13 +1048,20 @@ public static function handleCaptureThumbFinished(BatchJob $dbBatchJob, kCapture
$thumbAsset->incrementVersion();
$thumbAsset->setStatus(thumbAsset::FLAVOR_ASSET_STATUS_READY);


if(file_exists($data->getThumbPath()))
{
list($width, $height, $type, $attr) = getimagesize($data->getThumbPath());
$thumbAsset->setWidth($width);
$thumbAsset->setHeight($height);
$thumbAsset->setSize(filesize($data->getThumbPath()));

$thumbParamsOutput = assetParamsOutputPeer::retrieveByAssetId($data->getThumbAssetId());
if(KCsvWrapper::contains('bif', $thumbParamsOutput->getTags()))
{
$thumbAsset->setFileExt('bif');
$thumbAsset->setWidth($thumbParamsOutput->getWidth());
$thumbAsset->setHeight($thumbParamsOutput->getHeight());
}
}

$logPath = $data->getThumbPath() . '.log';
Expand Down
6 changes: 6 additions & 0 deletions alpha/apps/kaltura/lib/clipconcat/kClipManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public function createParentBatchJob($sourceEntryId,$clipEntry, $destEntry, $par
$parentJob->setPartnerId($partnerId);
$parentJob->setEntryId($clipEntry->getEntryId());

$trackEntry = new TrackEntry();
$trackEntry->setEntryId($destEntry->getEntryId());
$trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_CLIP);
$trackEntry->setDescription("source entry id: [" .$sourceEntryId. "], template entry id: [" .$clipEntry->getEntryId(). "].");
TrackEntry::addTrackEntry($trackEntry);

$jobData = new kClipConcatJobData($importUrl);
if(!$jobData->getImportNeeded())
{
Expand Down
2 changes: 1 addition & 1 deletion alpha/apps/kaltura/lib/kCurrentContext.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class kCurrentContext

/**
* This value is populated only in case of impersonation using partnerId in the request.
* It's used by the batch abd the admin console only.
* It's used by the batch and the admin console only.
*
* @var int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ protected function getIdFromPeer ( )
{
return UserEntryPeer::ID;
}
}
}
48 changes: 16 additions & 32 deletions alpha/apps/kaltura/lib/myEntryUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ public static function resizeEntryImage( entry $entry, $version , $width , $heig
$thumbCaptureByPackager = false;
$forceRotation = ($vid_slices > -1) ? self::getRotate($flavorAssetId) : 0;
$params = array($density, $quality, $forceRotation, $src_x, $src_y, $src_w, $src_h, $stripProfiles);
$shouldResizeByPackager = self::shouldResizeByPackager($params, $type, array($width, $height));
$shouldResizeByPackager = KThumbnailCapture::shouldResizeByPackager($params, $type, array($width, $height));
if (
// need to create a thumb if either:
// 1. entry is a video and a specific second was requested OR a slices were requested
Expand Down Expand Up @@ -959,7 +959,9 @@ public static function resizeEntryImage( entry $entry, $version , $width , $heig
$convertedImagePath = myFileConverter::convertImage($orig_image_path, $processingThumbPath, $width, $height, $type, $bgcolor, true, $quality, $src_x, $src_y, $src_w, $src_h, $density, $stripProfiles, $thumbParams, $format,$forceRotation);
}
if ($thumbCaptureByPackager && file_exists($packagerResizeFullPath))
{
unlink($packagerResizeFullPath);
}
}


Expand All @@ -982,13 +984,17 @@ public static function resizeEntryImage( entry $entry, $version , $width , $heig
}

if ($thumbCaptureByPackager && $shouldResizeByPackager && $multi && file_exists($packagerResizeFullPath))
{
unlink($packagerResizeFullPath);
}

if ($isEncryptionNeeded)
{
$fileSync->deleteTempClear();
if (self::isTempFile($orig_image_path) && file_exists($orig_image_path))
{
unlink($orig_image_path);
}
}
}

Expand Down Expand Up @@ -1138,27 +1144,6 @@ protected static function buildThumbUrl($entry, $flavorAsset)
return $url;
}


private static function curlThumbUrlWithOffset($url, $calc_vid_sec, $packagerCaptureUrl, $capturedThumbPath, $width = null, $height = null, $offsetPrefix = '')
{
$offset = floor($calc_vid_sec*1000);
if ($width)
$offset .= "-w$width";
if ($height)
$offset .= "-h$height";

$packagerThumbCapture = str_replace(
array ( "{url}", "{offset}" ),
array ( $url , $offsetPrefix . $offset ) ,
$packagerCaptureUrl );

$tempThumbPath = $capturedThumbPath.self::TEMP_FILE_POSTFIX;
kFile::closeDbConnections();
$success = KCurlWrapper::getDataFromFile($packagerThumbCapture, $tempThumbPath, null, true);
return $success;
}


public static function captureLocalThumb($entry, $capturedThumbPath, $calc_vid_sec, $cache, $cacheLockKey, $cacheLockKeyProcessing, &$flavorAssetId)
{
$flavorAsset = assetPeer::retrieveHighestBitrateByEntryId($entry->getId(), flavorParams::TAG_THUMBSOURCE);
Expand Down Expand Up @@ -2253,16 +2238,6 @@ private static function curlVolumeMapUrl($url, $packagerVolumeMapUrlPattern)
return $content;
}

private static function shouldResizeByPackager($params, $type, $dimension)
{
//check if all null or 0
$canBeHandle = (count(array_filter($params)) == 0);
// check if only one dimension is given or type 5 (stretches to the exact dimensions)
$positiveDimension = array_filter($dimension, function ($v) {return $v > 0;});
$validDimension = ($type == 5) || (count($positiveDimension) == 1);
return ($canBeHandle && $validDimension);
}

public static function addTrackEntryInfo(entry $entry,$message)
{
$trackEntry = new TrackEntry();
Expand Down Expand Up @@ -2297,4 +2272,13 @@ public static function verifyEntryType($entry)
}
}
}

public static function curlThumbUrlWithOffset($url, $calc_vid_sec, $packagerCaptureUrl, $capturedThumbPath, $width = null, $height = null, $offsetPrefix = '')
{
list($packagerThumbCapture, $tempThumbPath) = KThumbnailCapture::generateThumbUrlWithOffset($url, $calc_vid_sec, $packagerCaptureUrl, $capturedThumbPath, $width, $height, $offsetPrefix);
kFile::closeDbConnections();
$success = KCurlWrapper::getDataFromFile($packagerThumbCapture, $tempThumbPath, null, true);
return $success;
}

}
3 changes: 2 additions & 1 deletion alpha/apps/kaltura/lib/myPartnerRegistration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ private function sendRegistrationInformation(Partner $partner, kuser $adminKuse
$partner_type = 1;
}

if ($partner->getPartnerPackage() == PartnerPackages::PARTNER_PACKAGE_DEVELOPER_TRIAL)
$avoidRegistrationArray = array (PartnerPackages::PARTNER_PACKAGE_DEVELOPER_TRIAL,PartnerPackages::PARTNER_PACKAGE_DEVELOPER_COMMIT);
if(in_array($partner->getPartnerPackage(),$avoidRegistrationArray))
{
if ($existingUser) {
return; // emails will be sent via external system
Expand Down
4 changes: 4 additions & 0 deletions alpha/apps/kaltura/lib/reports/kKavaBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class kKavaBase extends kDruidBase
const DIMENSION_ENTRY_OWNER_ID = 'entryKuserId';
const DIMENSION_ENTRY_CREATOR_ID = 'entryCreatorId';
const DIMENSION_ENTRY_CREATED_AT = 'entryCreatedAt';
const DIMENSION_PERCENTILES = 'percentiles';
const DIMENSION_EVENT_VAR1 = 'eventVar1';
const DIMENSION_EVENT_VAR2 = 'eventVar2';
const DIMENSION_EVENT_VAR3 = 'eventVar3';

// metrics
const METRIC_COUNT = 'count';
Expand Down
Loading

0 comments on commit 3eaca59

Please sign in to comment.