diff options
author | Phie <phie@phie.ovh> | 2019-03-07 18:30:27 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-03-07 18:30:27 +0300 |
commit | 57fc475621f65534c1786b5020a66efab6144895 (patch) | |
tree | e2da77bc3c849c5198ac32135c0b4cdbf2021ef0 | |
parent | d6695df273f62510b4c6e1004710c51e77b1e926 (diff) |
-rw-r--r-- | CHANGELOG.md | 20 | ||||
-rwxr-xr-x | lib/Controller/NoteController.php | 9 | ||||
-rw-r--r-- | lib/Hooks/FSHooks.php | 7 | ||||
m--------- | templates/CarnetElectron | 0 |
4 files changed, 32 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d878d..85cc562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +# Version 0.13.0 + +Cache on server side + +Better media management of small screens + +Better search (ignoring accents + search amoung keywords) + +Rename after 10 secs instead of 2 in editor + +Print option + +Cancel load option + +Fix: + +remove < character + +search sentencies + # Version 0.12.1 Fix issue with reverse proxies diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index 1b96838..cb78e8c 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -17,14 +17,16 @@ return $this->inputStream; } } + $test = "bla"; class NoteController extends Controller { private $userId; private $bla; private $storage; private $CarnetFolder; private $db; + public static $lastWrite = null; public function __construct($AppName, IRequest $request, $UserId, $RootFolder, $Config, IDBConnection $IDBConnection){ - parent::__construct($AppName, $request); + parent::__construct($AppName, $request); $this->userId = $UserId; $this->db = $IDBConnection; $this->Config = $Config; @@ -441,7 +443,7 @@ if(empty($path)) continue; try{ - if(!array_key_exists($path, $metadataFromCache)|| True){ + if(!array_key_exists($path, $metadataFromCache)){ $utils = new NoteUtils(); $meta = $utils->getMetadata($this->CarnetFolder, $path); $array[$path] = $meta; @@ -650,6 +652,7 @@ $folder = $cache->get("currentnote".$id); $zipFile = new MyZipFile(); $this->addFolderContentToArchive($folder,$zipFile,""); + //self::$lastWrite = $this->CarnetFolder->getPath()."/".$path; //to avoid FSHooks rewrite of metadata $file = $this->CarnetFolder->newFile($path); //tried to do with a direct fopen on $file but lead to bad size on nextcloud $tmppath = tempnam(sys_get_temp_dir(), uniqid().".sqd"); @@ -660,6 +663,8 @@ $this->CarnetFolder->get($path)->delete(); } catch(\OCP\Files\NotFoundException $e) { } + //self::$lastWrite = $file->getPath(); + $file->putContent($tmph); fclose($tmph); } else diff --git a/lib/Hooks/FSHooks.php b/lib/Hooks/FSHooks.php index 5fabc0c..45d902d 100644 --- a/lib/Hooks/FSHooks.php +++ b/lib/Hooks/FSHooks.php @@ -3,7 +3,7 @@ namespace OCA\Carnet\Hooks; use OCP\IUserManager; use OCA\Carnet\Misc\CacheManager; use OCA\Carnet\Misc\NoteUtils; - +use OCA\Carnet\Controller\NoteController; use OCP\IDBConnection; class FSHooks { @@ -27,7 +27,7 @@ class FSHooks { } public function postWrite($node) { - + if(substr($node->getName(), -3) === "sqd"){ // to avoid getting carnet's path each time a file is writen //we check if is in our path @@ -35,6 +35,9 @@ class FSHooks { $relativePath = substr($node->getPath(), strlen($this->carnetFolder->getPath())); if(substr($relativePath, 0, 1) === "/") $relativePath = substr($relativePath, 1); + /*if(NoteController::$lastWrite === $node->getPath()){ + return; //was already handled in save + }*/ $cacheManager = new CacheManager($this->db); $utils = new NoteUtils(); $metadata = $utils->getMetadata($this->carnetFolder, $relativePath); diff --git a/templates/CarnetElectron b/templates/CarnetElectron -Subproject 3ee8b686ecec0fb6f73bb35e7ad0abe39183613 +Subproject 8cf44927597f4ff190a58fbd630538483958c14 |