diff --git a/airtime_mvc/application/common/HTTPHelper.php b/airtime_mvc/application/common/HTTPHelper.php index 80a40e2fc..80e6fd16e 100644 --- a/airtime_mvc/application/common/HTTPHelper.php +++ b/airtime_mvc/application/common/HTTPHelper.php @@ -37,6 +37,9 @@ class Application_Common_HTTPHelper if ($baseDir[0] != "/") { $baseDir = "/" . $baseDir; } + if (substr($baseDir, -1) != "/") { + $baseDir = $baseDir . "/"; + } $scheme = "http"; if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { @@ -102,4 +105,4 @@ class ZendActionHttpException extends Exception { parent::__construct($message, $code, $previous); } -} \ No newline at end of file +} diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index ad8ea50cc..e74fc1563 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1030,7 +1030,7 @@ SQL; $file = $storedFile->getPropelOrm(); //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 = Application_Common_HTTPHelper::getStationUrl() . "rest/media/" . $media_id; //$uri = $file->getAbsoluteFilePath(); $filesize = $file->getFileSize(); diff --git a/python_apps/pypo/pypo/pypofile.py b/python_apps/pypo/pypo/pypofile.py index df7e4f12d..9363bf6db 100644 --- a/python_apps/pypo/pypo/pypofile.py +++ b/python_apps/pypo/pypo/pypofile.py @@ -84,7 +84,7 @@ class PypoFile(Thread): handle.write(chunk) #make file world readable - os.chmod(dst, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) + os.chmod(dst, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH) if media_item['filesize'] == 0: file_size = self.report_file_size_and_md5_to_airtime(dst, media_item["id"], host, username)