Rename airtime_mvc/ to legacy/

This commit is contained in:
jo 2021-10-11 13:43:25 +02:00
parent f0879322c2
commit 3e18d42c8b
1316 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,43 @@
<?php
/**
* Skeleton subclass for representing a row from the 'podcast_episodes' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class PodcastEpisodes extends BasePodcastEpisodes
{
/**
* @override
* We need to override this function in order to provide the rotating
* download key for the station podcast.
*
* Get the [download_url] column value.
*
* @return string
*/
public function getDbDownloadUrl() {
$podcastId = $this->getDbPodcastId();
// We may have more station podcasts later, so use this instead of checking the id stored in Preference
$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()."rest/media/$fileId/download/$key.$ext";
}
return parent::getDbDownloadUrl();
}
}