SAAS-1011: Files stored locally with incorrect file extensions won't play out

This commit is contained in:
Albert Santoni 2015-08-11 09:33:29 -04:00
parent fc5d20f4d6
commit 249d3b1d2d
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}