From 249d3b1d2d72d6e0f2a26dadd0006f09d2816ea6 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Tue, 11 Aug 2015 09:33:29 -0400 Subject: [PATCH] SAAS-1011: Files stored locally with incorrect file extensions won't play out --- airtime_mvc/application/models/Schedule.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index bec73fc7d..f6967d254 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1019,9 +1019,11 @@ SQL; $media_id = $item['file_id']; $storedFile = Application_Model_StoredFile::RecallById($media_id); $file = $storedFile->getPropelOrm(); - $uri = $file->getAbsoluteFilePath(); + //Even local files are downloaded through the REST API in case we need to transform + //their filenames (eg. in the case of a bad file extension, because Liquidsoap won't play them) + $uri = Application_Common_HTTPHelper::getStationUrl() . "/rest/media/" . $media_id; + //$uri = $file->getAbsoluteFilePath(); - $baseUrl = Application_Common_OsPath::getBaseDir(); $filesize = $file->getFileSize(); self::createFileScheduleEvent($data, $item, $media_id, $uri, $filesize); }