Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Controller/NoteController.php16
m---------templates/CarnetElectron0
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php
index 40f4db9..ca354ac 100755
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/NoteController.php
@@ -107,13 +107,14 @@
* @NoAdminRequired
*/
public function getRecent() {
-
+ if(!$this->CarnetFolder->nodeExists("quickdoc/recentdb/recentnc"))
+ $this->mergeRecentDB();
$recents = json_decode($this->getRecentFile()->getContent(),true);
$paths = array();
if($recents['data'] == null)
$recents['data'] = array();
- if($recents['metadata'] != null){ //fix an old bug
+ if(isset($recents['metadata'])){ //fix an old bug
unset($recents['metadata']);
$this->internalSaveRecent(json_encode($recents));
}
@@ -229,7 +230,8 @@
* @NoCSRFRequired
*/
public function getKeywordsDB() {
-
+ if(!$this->CarnetFolder->nodeExists("quickdoc/keywords/keywordsnc"))
+ $this->mergeKeywordsDB();
return json_decode($this->getKeywordsDBFile()->getContent(),true);
}
@@ -325,9 +327,13 @@ public function getOpusEncoder(){
* @NoCSRFRequired
*/
public function mergeKeywordsDB() {
+ $lastmod = 0;
+ if(!$this->CarnetFolder->nodeExists("quickdoc/keywords/keywordsnc"))
+ $lastmod = -1;
$myDb = $this->getKeywordsDBFile();
$hasChanged = false;
- $lastmod = $myDb->getMTime();
+ if($lastmod != -1)
+ $lastmod = $myDb->getMTime();
foreach($this->CarnetFolder->get("quickdoc/keywords/")->getDirectoryListing() as $inDB){
if($inDB->getName() === $myDb->getName()||$inDB->getMTime()<$lastmod){
continue;
@@ -338,7 +344,7 @@ public function getOpusEncoder(){
foreach($thisDbContent->data as $action){
$isIn = false;
foreach($myDbContent->data as $actionMy){
- if($actionMy->keyword === $action->keyword && $actionMy->time === $action->time && $actionMy->path === $action->path && $actionMy->action === $action->action){
+ if($actionMy == $action){
$isIn = true;
break;
}
diff --git a/templates/CarnetElectron b/templates/CarnetElectron
-Subproject 962b205db0709ed8a416b64d87bd4d2931664a6
+Subproject 76a9c315fac0d31ef9826d5be92d1988bba2424