Merge pull request #309 from xabispacebiker/pypo-permission-fix

Pypo permission fix
This commit is contained in:
Lucas Bickel 2017-09-29 20:43:27 +02:00 committed by GitHub
commit b5b24f3464
3 changed files with 6 additions and 3 deletions

View file

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

View file

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

View file

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