Skip to content
Snippets Groups Projects
Commit cc7d5f01 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #76959 : fix RT + used space bug

parent 357af7b0
Branches
Tags
2 merge requests!2746Hotline,!2727Hotline#76959 vignettes manquantes dans kiosque notices
Pipeline #4584 passed with stage
in 35 minutes and 48 seconds
......@@ -30,8 +30,9 @@ class Admin_RecordsController extends ZendAfi_Controller_Action {
if ($album = $record->getAlbum()){
$album->createThumbnail();
$url_vignette = $album->getThumbnailUrl();
$record->setUrlVignette($url_vignette);
$record->setUrlImage($url_vignette);
$record->setUrlImage(($poster = $album->getPoster()) ? $poster : $url_vignette);
$record->save();
$this->_helper->notify($this->_('Vignette réinitialisée pour "%s"', $record->getTitrePrincipal()));
......
......@@ -181,9 +181,7 @@ class Class_FileManager extends Class_Entity {
protected static function _isPath($url_or_path) {
return Class_Url::isAnUrl($url_or_path)
? false
: true;
return !Class_Url::isAnUrl($url_or_path);
}
......
......@@ -231,8 +231,9 @@ class Class_FileManager_FileSystem {
$path = $root->getRealpath();
$total = Class_AdminVar::get('ALLOWED_DISK_SPACE') * 1024 * 1024;
$used = exec(sprintf('du -0sb %s', $path));
$used = filter_var($used, FILTER_SANITIZE_NUMBER_INT);
$free = $total >= $used ? $total - $used : 0;
$parts = explode("\t", $used);
$used = (int)$parts[0];
$free = ($total >= $used) ? ($total - $used) : 0;
$used_percent = sprintf('%.2f',($used / $total) * 100) . '%';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment