diff Framework/Plugins/IndexBackend.cpp @ 209:13a3863df7fa

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Mar 2021 17:01:38 +0100
parents 2089d4071408
children a0c095a4ba7d
line wrap: on
line diff
--- a/Framework/Plugins/IndexBackend.cpp	Fri Mar 19 15:40:50 2021 +0100
+++ b/Framework/Plugins/IndexBackend.cpp	Fri Mar 19 17:01:38 2021 +0100
@@ -730,7 +730,7 @@
   }
 
     
-  uint64_t IndexBackend::GetResourceCount(OrthancPluginResourceType resourceType)
+  uint64_t IndexBackend::GetResourcesCount(OrthancPluginResourceType resourceType)
   {
     std::unique_ptr<DatabaseManager::CachedStatement> statement;
 
@@ -939,16 +939,11 @@
   }
 
     
-  void IndexBackend::LogChange(const OrthancPluginChange& change)
+  void IndexBackend::LogChange(int32_t changeType,
+                               int64_t resourceId,
+                               OrthancPluginResourceType resourceType,
+                               const char* date)
   {
-    int64_t id;
-    OrthancPluginResourceType type;
-    if (!LookupResource(id, type, change.publicId) ||
-        type != change.resourceType)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);
-    }
-      
     DatabaseManager::CachedStatement statement(
       STATEMENT_FROM_HERE, manager_,
       "INSERT INTO Changes VALUES(${}, ${changeType}, ${id}, ${resourceType}, ${date})");
@@ -959,10 +954,10 @@
     statement.SetParameterType("date", ValueType_Utf8String);
 
     Dictionary args;
-    args.SetIntegerValue("changeType", change.changeType);
-    args.SetIntegerValue("id", id);
-    args.SetIntegerValue("resourceType", change.resourceType);
-    args.SetUtf8Value("date", change.date);
+    args.SetIntegerValue("changeType", changeType);
+    args.SetIntegerValue("id", resourceId);
+    args.SetIntegerValue("resourceType", resourceType);
+    args.SetUtf8Value("date", date);
 
     statement.Execute(args);
   }
@@ -1504,7 +1499,7 @@
 
 
   // For unit testing only!
-  uint64_t IndexBackend::GetResourcesCount()
+  uint64_t IndexBackend::GetAllResourcesCount()
   {
     std::unique_ptr<DatabaseManager::CachedStatement> statement;