Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mercury 13.15.0 plat 8651 chop and slice #6938

Merged
merged 23 commits into from Apr 2, 2018

Conversation

RoieBeck
Copy link
Contributor

@RoieBeck RoieBeck commented Apr 1, 2018

chop and slice pull request - server.

* @param array $dynamicAttributes
* @return bool is clip attribute exist in dynamic attribute
*/
public static function isClipServiceRequired(array $dynamicAttributes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is confusing , since you are looking for multi clip service, rename to isMutliClip(

Copy link
Contributor Author

@RoieBeck RoieBeck Apr 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isMultipleClipOperation done

* @param BatchJob $batchJob
* @return bool are all clip batch done
*/
private function handleClipChildJob($batchJob)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename - handle... function should do something, this one returns true or false. rename to shouldHandle....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

areAllClipJobsDone done

$this->handleClipConcatParentJob($batchJob);
}

if ($batchJob->getParentJob() && $batchJob->getParentJob()->getJobType() == BatchJobType::CONVERT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that jobType will b CLIP_CONCAT and also parentJob will be convert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, CLIP_CONCAT is the root job, it is not born from any job

$flavorAsset->setPartnerId($partnerId);
$flavorAsset->setEntryId($entryId);
$flavorAsset->save();
$flavorAsset->putInCustomData(self::CLIP_NUMBER,$order);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save should be done after setting clip number

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

$jobData = $batchJob->getData();

$tempEntry = entryPeer::retrieveByPK($jobData->getTempEntryId());
$assets = assetPeer::retrieveByEntryId($jobData->getTempEntryId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to limit asset to the only type you know to concat which is flavorAsset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$assets = assetPeer::retrieveByEntryId($jobData->getTempEntryId(), array(assetType::FLAVOR));

$operationAttributes = $resource->getOperationAttributes();
$internalResource = $resource->getResource();
if($internalResource instanceof kLiveEntryResource)
if (kClipManager::isClipServiceRequired($operationAttributes))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename isMulti....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* @param BaseObject $object
* @return bool
*/
protected static function getClipConcatFlow( BaseObject $object ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename , this should be isClipConcatFlow

Copy link
Contributor Author

@RoieBeck RoieBeck Apr 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done also in KCuePointMangaer

$pager = new KalturaFilterPager();
$pager->pageSize = self::MAX_CUE_POINTS_TO_COPY_TO_VOD;
/** @noinspection PhpUndefinedFieldInspection */
$result = KBatchBase::$kClient->cuePoint->listAction($filter, $pager);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try / catch this call with at list 3 retries.

$cuePointDestEndTime = min($cuePoint->endTime - $clipStartTime + $offsetInDestination, $clipEndTime - $clipStartTime + $offsetInDestination);
}
/** @noinspection PhpUndefinedFieldInspection */
$clonedCuePoint = KBatchBase::$kClient->cuePoint->cloneAction($cuePoint->id, $destinationEntryId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try/catch action

}
if ($clonedCuePoint) {
/** @noinspection PhpUndefinedFieldInspection */
$res = $this->updateCuePointTimes($clonedCuePoint, $cuePointDestStartTime,$cuePointDestEndTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here - try / catch and retry 3 times. Beside API exception invalid cue point ID.

@RoieBeck RoieBeck merged commit f7772e3 into Mercury-13.17.0 Apr 2, 2018
@RoieBeck RoieBeck deleted the Mercury-13.15.0-PLAT-8651-Chop-And-Slice branch April 2, 2018 09:01
@RoieBeck
Copy link
Contributor Author

RoieBeck commented Apr 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants