diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index ef694ccf2..8c7e242e6 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -214,36 +214,16 @@ class Application_Model_Systemstatus { $partions = array(); - if (isset($_SERVER['AIRTIME_SRV'])) { - //connect to DB and find how much total space user has allocated. - $totalSpace = Application_Model_Preference::GetDiskQuota(); + //connect to DB and find how much total space user has allocated. + $totalSpace = Application_Model_Preference::GetDiskQuota(); - $storPath = Application_Model_MusicDir::getStorDir()->getDirectory(); + $storPath = Application_Model_MusicDir::getStorDir()->getDirectory(); - list($usedSpace,) = preg_split("/[\s]+/", exec("du -bs $storPath")); + list($usedSpace,) = preg_split("/[\s]+/", exec("du -bs $storPath")); - $partitions[$totalSpace]->totalSpace = $totalSpace; - $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; - Logging::info($partitions[$totalSpace]->totalFreeSpace); - } else { - /* First lets get all the watched directories. Then we can group them - * into the same partitions by comparing the partition sizes. */ - $musicDirs = Application_Model_MusicDir::getWatchedDirs(); - $musicDirs[] = Application_Model_MusicDir::getStorDir(); - - foreach ($musicDirs as $md) { - $totalSpace = disk_total_space($md->getDirectory()); - - if (!isset($partitions[$totalSpace])) { - $partitions[$totalSpace] = new StdClass; - $partitions[$totalSpace]->totalSpace = $totalSpace; - $partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory()); - - } - - $partitions[$totalSpace]->dirs[] = $md->getDirectory(); - } - } + $partitions[$totalSpace]->totalSpace = $totalSpace; + $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; + Logging::info($partitions[$totalSpace]->totalFreeSpace); return array_values($partitions); }