diff --git a/alpha/lib/model/DeliveryProfile.php b/alpha/lib/model/DeliveryProfile.php index f5070b8ff81..40640c95fdf 100644 --- a/alpha/lib/model/DeliveryProfile.php +++ b/alpha/lib/model/DeliveryProfile.php @@ -7,7 +7,7 @@ */ abstract class DeliveryProfile extends BaseDeliveryProfile implements IBaseObject { - abstract protected function buildServeFlavors(); + abstract public function buildServeFlavors(); protected $DEFAULT_RENDERER_CLASS = 'kF4MManifestRenderer'; diff --git a/alpha/lib/model/FileSync.php b/alpha/lib/model/FileSync.php index 2e541ada895..79859de0296 100644 --- a/alpha/lib/model/FileSync.php +++ b/alpha/lib/model/FileSync.php @@ -282,7 +282,18 @@ public function getStatusAsString() { return (isset($this->statusMap[$this->getStatus()])) ? $this->statusMap[$this->getStatus()] : "Unknown"; } - + + protected function getServeUrl($entryId) + { + $dynamicAttributes = DeliveryProfileDynamicAttributes::init($this->getDc(), $entryId, PlaybackProtocol::HTTP, infraRequestUtils::getProtocol()); + $flavorAsset = assetPeer::retrieveById($this->getObjectId()); + $dynamicAttributes->setFlavorAssets(array($flavorAsset)); + $urlManager = DeliveryProfilePeer::getRemoteDeliveryByStorageId($dynamicAttributes); + $urlManager->setDynamicAttributes($dynamicAttributes); + $url = $urlManager->buildServeFlavors(); + return ($url[0]['urlPrefix'] . $url[0]['url']); + } + public function getExternalUrl($entryId, $format = PlaybackProtocol::HTTP) { $storage = StorageProfilePeer::retrieveByPK($this->getDc()); @@ -294,6 +305,11 @@ public function getExternalUrl($entryId, $format = PlaybackProtocol::HTTP) return null; } + if(in_array($this->getDc(), kStorageExporter::getPeriodicStorageIdsByPartner($this->getPartnerId()))) + { + return $this->getServeUrl($entryId); + } + $urlManager = DeliveryProfilePeer::getRemoteDeliveryByStorageId(DeliveryProfileDynamicAttributes::init($this->getDc(), $entryId, PlaybackProtocol::HTTP, infraRequestUtils::getProtocol())); if(is_null($urlManager) && infraRequestUtils::getProtocol() != 'http') $urlManager = DeliveryProfilePeer::getRemoteDeliveryByStorageId(DeliveryProfileDynamicAttributes::init($this->getDc(), $entryId));