comparison Framework/Plugins/DatabaseBackendAdapterV2.cpp @ 209:13a3863df7fa

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Mar 2021 17:01:38 +0100
parents d9ef3f16e6a2
children 821d4ba83dc3
comparison
equal deleted inserted replaced
208:696bc0c9fddb 209:13a3863df7fa
646 { 646 {
647 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload); 647 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload);
648 648
649 try 649 try
650 { 650 {
651 *target = backend->GetResourceCount(resourceType); 651 *target = backend->GetResourcesCount(resourceType);
652 return OrthancPluginErrorCode_Success; 652 return OrthancPluginErrorCode_Success;
653 } 653 }
654 ORTHANC_PLUGINS_DATABASE_CATCH; 654 ORTHANC_PLUGINS_DATABASE_CATCH;
655 } 655 }
656 656
787 { 787 {
788 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload); 788 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload);
789 789
790 try 790 try
791 { 791 {
792 backend->LogChange(*change); 792 int64_t id;
793 OrthancPluginResourceType type;
794 if (!backend->LookupResource(id, type, change->publicId) ||
795 type != change->resourceType)
796 {
797 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);
798 }
799 else
800 {
801 backend->LogChange(change->changeType, id, type, change->date);
802 }
803
793 return OrthancPluginErrorCode_Success; 804 return OrthancPluginErrorCode_Success;
794 } 805 }
795 ORTHANC_PLUGINS_DATABASE_CATCH; 806 ORTHANC_PLUGINS_DATABASE_CATCH;
796 } 807 }
797 808