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

Naos 14.15.0 sup 16956 #8151

Merged
merged 2 commits into from
Feb 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions alpha/apps/kaltura/lib/myPlaylistUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,21 +879,23 @@ private static function updateEntryFilter(entryFilter $entry_filter, $partner_id

/**
* @param $captionAsset
* @param $filteredCaptionAssets
* @return array
* @param &$localFilePath
* @return boolean
* @throws Exception
*/
protected static function getCaptionFilePath($captionAsset)
protected static function getCaptionFilePath($captionAsset, &$localFilePath)
{
$captionFileSyncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);

list($captionFileSync, $local) = kFileSyncUtils::getReadyFileSyncForKey($captionFileSyncKey, false, false);
if ($captionFileSync)
list($captionFileSync, $local) = kFileSyncUtils::getReadyFileSyncForKey($captionFileSyncKey, true, false);
if (!$captionFileSync)
{
$captionFullPath = $captionFileSync->getFullPath();
return $captionFullPath;
return false;
}
return false;
if($local)
{
$localFilePath = $captionFileSync->getFullPath();
}
return true;
}

/**
Expand Down Expand Up @@ -1197,15 +1199,18 @@ protected static function getCaptionFilesForEntryIds($entryIds, $captionLanguage
if(!$captionAsset->getDisplayOnPlayer())
continue;

$filePath = self::getCaptionFilePath($captionAsset);
if ($filePath)
//Try getting caption
//if exist but no local - return empty path
$localFilePath = '';
$fileSyncExist = self::getCaptionFilePath($captionAsset, $localFilePath);
if ($fileSyncExist)
{
if (!isset($filteredCaptionAssets[$captionAsset->getEntryId()]))
$filteredCaptionAssets[$captionAsset->getEntryId()] = array();
if (!isset($filteredCaptionAssets[$captionAsset->getEntryId()][$captionAsset->getLanguage()]))
$filteredCaptionAssets[$captionAsset->getEntryId()][$captionAsset->getLanguage()] = array();
$filteredCaptionAssets[$captionAsset->getEntryId()][$captionAsset->getLanguage()] =
array(self::CAPTION_FILES_LABEL => $captionAsset->getLabel(), self::CAPTION_FILES_PATH => $filePath, self::CAPTION_FILES_ID => $captionAsset->getId());
array(self::CAPTION_FILES_LABEL => $captionAsset->getLabel(), self::CAPTION_FILES_PATH => $localFilePath, self::CAPTION_FILES_ID => $captionAsset->getId());
}
}
return $filteredCaptionAssets;
Expand Down