コード例 #1
0
 public function isImportInProgressAction()
 {
     $now = time();
     $res = false;
     if (Application_Model_Preference::GetImportTimestamp() + 10 > $now) {
         $res = true;
     }
     die(json_encode($res));
 }
コード例 #2
0
ファイル: MusicDir.php プロジェクト: nidzix/Airtime
 public static function setStorDir($p_dir)
 {
     // we want to be consistent when storing dir path.
     // path should always ends with trailing '/'
     $p_dir = Application_Common_OsPath::normpath($p_dir) . "/";
     if (!is_dir($p_dir)) {
         return array("code" => 2, "error" => "'{$p_dir}' is not a valid directory.");
     } elseif (Application_Model_Preference::GetImportTimestamp() + 10 > time()) {
         return array("code" => 3, "error" => "Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
     }
     $dir = self::getStorDir();
     // if $p_dir doesn't exist in DB
     $exist = $dir->getDirByPath($p_dir);
     if ($exist == NULL) {
         $dir->setDirectory($p_dir);
         $dirId = $dir->getId();
         $data = array();
         $data["directory"] = $p_dir;
         $data["dir_id"] = $dirId;
         Application_Model_RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
         return array("code" => 0);
     } else {
         return array("code" => 1, "error" => "'{$p_dir}' is already set as the current storage dir or in the watched folders list.");
     }
 }
コード例 #3
0
 public function isImportInProgressAction()
 {
     $now = time();
     $res = false;
     if (Application_Model_Preference::GetImportTimestamp() + 10 > $now) {
         $res = true;
     }
     $this->_helper->json->sendJson($res);
 }
コード例 #4
0
ファイル: Preference.php プロジェクト: romansavrulin/Airtime
 public static function SetImportTimestamp()
 {
     $now = time();
     if (Application_Model_Preference::GetImportTimestamp() + 5 < $now) {
         Application_Model_Preference::SetValue("import_timestamp", $now);
     }
 }