Merge branch 'saas-dev-publishing' of github.com:sourcefabric/Airtime into saas-dev-publishing

This commit is contained in:
Albert Santoni 2015-11-17 18:34:06 -05:00
commit c89941d312
3 changed files with 8 additions and 3 deletions

View File

@ -44,7 +44,12 @@ class Application_Common_HTTPHelper
$basePort = "443"; //Airtime Pro compatibility hack $basePort = "443"; //Airtime Pro compatibility hack
} }
$stationUrl = "$scheme://${baseUrl}:${basePort}${baseDir}"; $portStr = "";
if (!(($scheme == "http" && $basePort == "80")
|| ($scheme == "https" && $basePort == "443"))) {
$portStr = ":${basePort}";
}
$stationUrl = "$scheme://${baseUrl}${portStr}${baseDir}";
return $stationUrl; return $stationUrl;
} }

View File

@ -32,7 +32,7 @@ class PodcastEpisodes extends BasePodcastEpisodes
if ($podcast) { if ($podcast) {
$fileId = $this->getDbFileId(); $fileId = $this->getDbFileId();
$key = Application_Model_Preference::getStationPodcastDownloadKey(); $key = Application_Model_Preference::getStationPodcastDownloadKey();
return Application_Common_HTTPHelper::getStationUrl()."rest/media/$fileId/download?download_key=$key"; return Application_Common_HTTPHelper::getStationUrl(false)."rest/media/$fileId/download?download_key=$key";
} }
return parent::getDbDownloadUrl(); return parent::getDbDownloadUrl();
} }

View File

@ -193,7 +193,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
*/ */
public function publish($fileId) { public function publish($fileId) {
$id = Application_Model_Preference::getStationPodcastId(); $id = Application_Model_Preference::getStationPodcastId();
$url = $guid = Application_Common_HTTPHelper::getStationUrl()."rest/media/$fileId/download"; $url = $guid = Application_Common_HTTPHelper::getStationUrl(false)."rest/media/$fileId/download";
if (!PodcastEpisodesQuery::create() if (!PodcastEpisodesQuery::create()
->filterByDbPodcastId($id) ->filterByDbPodcastId($id)
->findOneByDbFileId($fileId)) { // Don't allow duplicate episodes ->findOneByDbFileId($fileId)) { // Don't allow duplicate episodes