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

This commit is contained in:
Albert Santoni 2015-11-18 12:38:22 -05:00
commit ba832ffe3a
10 changed files with 52 additions and 16 deletions

View file

@ -1573,6 +1573,11 @@ class Application_Model_Preference
}
public static function getStationPodcastPrivacy() {
if (!Billing::isStationPodcastAllowed()) {
// return private setting
return 1;
}
return self::getValue("station_podcast_privacy");
}

View file

@ -31,8 +31,11 @@ class PodcastEpisodes extends BasePodcastEpisodes
$podcast = StationPodcastQuery::create()->findOneByDbPodcastId($podcastId);
if ($podcast) {
$fileId = $this->getDbFileId();
// FIXME: this is an interim solution until we can do better...
$file = CcFilesQuery::create()->findPk($fileId);
$ext = FileDataHelper::getAudioMimeTypeArray()[$file->getDbMime()];
$key = Application_Model_Preference::getStationPodcastDownloadKey();
return Application_Common_HTTPHelper::getStationUrl(false)."rest/media/$fileId/download/$key";
return Application_Common_HTTPHelper::getStationUrl()."rest/media/$fileId/download/$key.$ext";
}
return parent::getDbDownloadUrl();
}