Merge pull request #309 from xabispacebiker/pypo-permission-fix
Pypo permission fix
This commit is contained in:
commit
b5b24f3464
3 changed files with 6 additions and 3 deletions
|
@ -37,6 +37,9 @@ class Application_Common_HTTPHelper
|
||||||
if ($baseDir[0] != "/") {
|
if ($baseDir[0] != "/") {
|
||||||
$baseDir = "/" . $baseDir;
|
$baseDir = "/" . $baseDir;
|
||||||
}
|
}
|
||||||
|
if (substr($baseDir, -1) != "/") {
|
||||||
|
$baseDir = $baseDir . "/";
|
||||||
|
}
|
||||||
|
|
||||||
$scheme = "http";
|
$scheme = "http";
|
||||||
if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
|
if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ SQL;
|
||||||
$file = $storedFile->getPropelOrm();
|
$file = $storedFile->getPropelOrm();
|
||||||
//Even local files are downloaded through the REST API in case we need to transform
|
//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)
|
//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();
|
//$uri = $file->getAbsoluteFilePath();
|
||||||
|
|
||||||
$filesize = $file->getFileSize();
|
$filesize = $file->getFileSize();
|
||||||
|
|
|
@ -84,7 +84,7 @@ class PypoFile(Thread):
|
||||||
handle.write(chunk)
|
handle.write(chunk)
|
||||||
|
|
||||||
#make file world readable
|
#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:
|
if media_item['filesize'] == 0:
|
||||||
file_size = self.report_file_size_and_md5_to_airtime(dst, media_item["id"], host, username)
|
file_size = self.report_file_size_and_md5_to_airtime(dst, media_item["id"], host, username)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue