Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

🎁 delete child works if the parent work is deleted #657

Closed
wants to merge 1 commit into from

Conversation

ShanaLMoore
Copy link
Contributor

@ShanaLMoore ShanaLMoore commented Nov 10, 2023

Story

TODO: This solution is too aggressive. This solution deletes anything in parent.ordered_works when the parent gets deleted, when really we want to delete any child works derived from the deleted PDF of a parent work.

In IiifPrint,
When a file set (PDF) gets deleted we will need to find the child works (pages) and any pending relationships related to it.

we should have a relationships or pending relationships (maybe sometimes both). delete the related
see #destroy_potential_children. Don't target all the PDFs. Only pending relationships for specific pdf.

See reload_single_pdf_job.rb (but this is too aggressive also and would only work for adventist).

Refs:

  • #issuenumber

Expected Behavior Before Changes

Expected Behavior After Changes

Screenshots / Video

Notes

@laritakr
Copy link
Contributor

The goal of this work was to delete the child works when a fileset is removed, not when the parent work is removed.

I believe we already delete the child work when the parent is deleted, but this may not be the case. We should probably verify this.

@laritakr
Copy link
Contributor

Needed work is included in notch8/iiif_print#288

@laritakr laritakr closed this Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants