Project

General

Profile

Actions

bug #9855

closed

Specimen images sometimes show duplicates

Added by Andreas Müller over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:

Actions #1

Updated by Andreas Müller over 2 years ago

AK:

eu.etaxonomy.cdm.remote.controller.iiif.ManifestController.doTaxonMedia()

Actions #2

Updated by Andreas Müller over 2 years ago

  • Status changed from New to In Progress

Duplication only happens in UniversalViewer (using the ManifestController.doTaxonMedia()) code. Switching to simple viewer does not show duplicates.

Actions #3

Updated by Andreas Kohlbecker over 2 years ago

Andreas Müller wrote:

Duplication only happens in UniversalViewer (using the ManifestController.doTaxonMedia()) code. Switching to simple viewer does not show duplicates.

So this clearly related to eu.etaxonomy.cdm.remote.controller.iiif.ManifestController.doTaxonMedia()

Actions #4

Updated by Andreas Müller over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50
Actions #5

Updated by Andreas Müller over 2 years ago

  • % Done changed from 50 to 0

The reason for the duplicates was that in TaxonServiceImpl.listMedia() media were not deduplicate if e.g. an image of a MediaSpecimen was also attached via image gallery to an occurrence. This is dirty data but happenes due to a bug in ABCD import.

I added deduplication if duplicated images exist for whatever reason. Additionally I fixed the ABCD bug to avoid such media duplicates in future.

Actions #6

Updated by Andreas Müller over 2 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 0 to 50

AK can you please review if the result is as expected.

KL can you please review the fix for ABCD.

Actions #7

Updated by Andreas Kohlbecker about 2 years ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

For de-duplicating the Media in TaxonService.listMedia() I suggest to use a more modern java code style:

taxonMedia = taxonMedia.stream().distinct().collect(Collectors.toList());

this way the CdmUtils.removeIdentical() method can be removed - it is used only once in the library.

Actions #8

Updated by Andreas Müller about 2 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Andreas Kohlbecker wrote in #note-7:

For de-duplicating the Media in TaxonService.listMedia() I suggest to use a more modern java code style:

taxonMedia = taxonMedia.stream().distinct().collect(Collectors.toList());

this way the CdmUtils.removeIdentical() method can be removed - it is used only once in the library.

Good point. I adapted the code accordingly. Can you check again and then pass the ticket to KL?

Actions #9

Updated by Andreas Kohlbecker about 2 years ago

  • Assignee changed from Andreas Kohlbecker to Katja Luther
  • % Done changed from 50 to 70

Excellent!

@Katja: I's your turn now.

Actions #10

Updated by Katja Luther about 2 years ago

  • Assignee changed from Katja Luther to Andreas Müller

The ABCD Import code is correct, too. So I think we can close this ticket.

Actions #11

Updated by Andreas Müller about 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100
Actions #12

Updated by Andreas Müller about 2 years ago

  • Target version changed from Release 5.45 to Release 5.29
Actions

Also available in: Atom PDF