Mercurial > hg > orthanc-databases
changeset 670:cc5d783fccbb attach-custom-data
fix build against released versions of the Orthanc SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 30 May 2025 12:11:34 +0200 |
parents | 0b35221b1d44 |
children | 22fea036075d |
files | Framework/Plugins/IndexBackend.cpp |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Plugins/IndexBackend.cpp Wed May 28 15:26:15 2025 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Fri May 30 12:11:34 2025 +0200 @@ -4250,12 +4250,16 @@ attachment->set_uuid(statement->ReadString(C3_STRING_1)); attachment->set_uncompressed_hash(statement->ReadString(C4_STRING_2)); attachment->set_compressed_hash(statement->ReadString(C5_STRING_3)); - attachment->set_custom_data(statement->ReadStringOrNull(C6_STRING_4)); + attachment->set_content_type(statement->ReadInteger32(C7_INT_1)); attachment->set_compression_type(statement->ReadInteger32(C9_INT_3)); attachment->set_compressed_size(statement->ReadInteger64(C10_BIG_INT_1)); attachment->set_uncompressed_size(statement->ReadInteger64(C11_BIG_INT_2)); +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 8) + attachment->set_custom_data(statement->ReadStringOrNull(C6_STRING_4)); +#endif + if (!statement->IsNull(C8_INT_2)) // revision can be null for files that have been atttached by older Orthanc versions { responses[internalId]->add_attachments_revisions(statement->ReadInteger32(C8_INT_2)); @@ -4352,11 +4356,14 @@ attachment->set_uuid(statement->ReadString(C3_STRING_1)); attachment->set_uncompressed_hash(statement->ReadString(C4_STRING_2)); attachment->set_compressed_hash(statement->ReadString(C5_STRING_3)); - attachment->set_custom_data(statement->ReadStringOrNull(C6_STRING_4)); attachment->set_content_type(statement->ReadInteger32(C7_INT_1)); attachment->set_compression_type(statement->ReadInteger32(C9_INT_3)); attachment->set_compressed_size(statement->ReadInteger64(C10_BIG_INT_1)); attachment->set_uncompressed_size(statement->ReadInteger64(C11_BIG_INT_2)); + +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 8) + attachment->set_custom_data(statement->ReadStringOrNull(C6_STRING_4)); +#endif }; break; default: