# HG changeset patch # User Alain Mazy # Date 1684771086 -7200 # Node ID c78138dc3889eaf68c22848df0b8ea523ae74f13 # Parent 5053a10da5a23589c76855ab44c171f6c2295679 When deleting a resource, its parents LastUpdate metadata is now updated diff -r 5053a10da5a2 -r c78138dc3889 NEWS --- a/NEWS Mon May 22 15:00:01 2023 +0200 +++ b/NEWS Mon May 22 17:58:06 2023 +0200 @@ -12,6 +12,7 @@ - boost 1.82.0 * Fix orphan files remaining in storage when working with MaximumStorageSize (https://discourse.orthanc-server.org/t/issue-with-deleting-incoming-dicoms-when-maximumstoragesize-is-reached/3510) +* When deleting a resource, its parents LastUpdate metadata is now updated. Version 1.12.0 (2023-04-14) diff -r 5053a10da5a2 -r c78138dc3889 OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Mon May 22 15:00:01 2023 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Mon May 22 17:58:06 2023 +0200 @@ -2036,6 +2036,24 @@ remainingAncestor_["RemainingAncestor"]["Path"] = GetBasePath(remainingLevel, remainingPublicId); remainingAncestor_["RemainingAncestor"]["Type"] = EnumerationToString(remainingLevel); remainingAncestor_["RemainingAncestor"]["ID"] = remainingPublicId; + + { // update the LastUpdate metadata of all parents + std::string now = SystemToolbox::GetNowIsoString(true /* use UTC time (not local time) */); + ResourcesContent content(true); + + int64_t parentId = 0; + if (transaction.LookupResource(parentId, remainingLevel, remainingPublicId)) + { + + do + { + content.AddMetadata(parentId, MetadataType_LastUpdate, now); + } + while (transaction.LookupParent(parentId, parentId)); + + transaction.SetResourcesContent(content); + } + } } else {