From 58e864f0b63d29c240ca1840af2efaef6d8808c5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 12 Dec 2022 19:00:52 +0100 Subject: [PATCH] pass inbox tags to __getCategoryData() --- class.paperless.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/class.paperless.php b/class.paperless.php index 78cf7c8..0b5732b 100644 --- a/class.paperless.php +++ b/class.paperless.php @@ -101,10 +101,10 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */ $g = hexdec(substr($hexcolor, 3, 2)); $b = hexdec(substr($hexcolor, 5, 2)); $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; - return ($yiq >= 128) ? '000000' : 'ffffff'; + return ($yiq >= 148) ? '000000' : 'ffffff'; } - protected function __getCategoryData($category) { /* {{{ */ + protected function __getCategoryData($category, $inboxtags) { /* {{{ */ $color = substr(md5($category->getName()), 0, 6); $data = [ 'id'=>(int)$category->getId(), @@ -115,7 +115,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */ 'match'=>'', 'matching_algorithm'=>6, 'is_insensitive'=>true, - 'is_inbox_tag'=>$category->getName() == 'Computer', + 'is_inbox_tag'=>in_array($category->getId(), $inboxtags), 'document_count'=>0 ]; return $data;