From 48efcda90f5614094b566404730855201592139b Mon Sep 17 00:00:00 2001 From: MosheMaorKaltura Date: Tue, 19 Feb 2019 11:28:46 +0200 Subject: [PATCH 1/2] SUP16956: bumper - if caption file found remotely , return empty string --- .../kaltura/lib/myPlaylistUtils.class.php | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/alpha/apps/kaltura/lib/myPlaylistUtils.class.php b/alpha/apps/kaltura/lib/myPlaylistUtils.class.php index f419069997a..51db975afba 100644 --- a/alpha/apps/kaltura/lib/myPlaylistUtils.class.php +++ b/alpha/apps/kaltura/lib/myPlaylistUtils.class.php @@ -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; } /** @@ -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; From d29597f21eb80cfd189257f754a849056705463c Mon Sep 17 00:00:00 2001 From: MosheMaorKaltura Date: Tue, 19 Feb 2019 13:11:46 +0200 Subject: [PATCH 2/2] SUP16956: bumper - if caption file found remotely , return empty string --- alpha/apps/kaltura/lib/myPlaylistUtils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpha/apps/kaltura/lib/myPlaylistUtils.class.php b/alpha/apps/kaltura/lib/myPlaylistUtils.class.php index 51db975afba..e2c152db59a 100644 --- a/alpha/apps/kaltura/lib/myPlaylistUtils.class.php +++ b/alpha/apps/kaltura/lib/myPlaylistUtils.class.php @@ -1202,7 +1202,7 @@ protected static function getCaptionFilesForEntryIds($entryIds, $captionLanguage //Try getting caption //if exist but no local - return empty path $localFilePath = ''; - $fileSyncExist = self::getCaptionFilePath($captionAsset,$localFilePath); + $fileSyncExist = self::getCaptionFilePath($captionAsset, $localFilePath); if ($fileSyncExist) { if (!isset($filteredCaptionAssets[$captionAsset->getEntryId()]))