-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎁 IiifPrint Enhancements to clean up split works as PDF fileset is deleted #288
Conversation
f79bf7f
to
cff0d69
Compare
TODO: Add file set id to pending table |
Also some lint fixes.
After creating relationships remove the PendingRelationships entries, as they are no longer needed, even if we have more relationships than expected. Cleanup may be needed so still log the error to report the excess relationships.
When a fileset is destroyed containing a PDF which was used to split into child works, this service performs the necessary cleanup.
This plugs into the cleanup file sets process, to add additional cleanup of child works which were created as part of a IiifPrint PDF split. Other child works are not affected.
@@ -4,6 +4,10 @@ module RDF | |||
class CustomIsChildTerm < Vocabulary('http://id.loc.gov/vocabulary/identifiers/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe consider renaming this file since it's doing more than setting the child flag now. I suppose that would be a breaking change so we could also cut a new release?
Now that I say that, maybe that can be a TODO for later given the urgency 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol yeah I considered that but since it's included in EVERY repo that uses IiifPrint, it's def a breaking change which is why I left it. Plus it's still a type of child flag if you stretch hard enough. ;)
Note: using this update requires running
rails iiif_print:install:migrations
in your application to pull in the additional database migration.related to
Add parent_model, child_model, and file_id to the iiif_print_pending_relationships table for easier queries.
The goal here is twofold:
Add service to destroy child works and pending relationships as a PDF fileset is destroyed.
Future enhancements could include:
Removes IiifPrint::PendingRelationships table entries when relationships are formed without errors, regardless whether the count matches.
Errors are still reported on the job, so followup can be done if needed, but the relationship table entries are unnecessary in this situation.
Destroys spawned child works as file_set is destroyed. Child works which were NOT created as part of PDF splitting will not be affected by this.
Screenshots
Work with two PDF filesets, both split into children
Work after one of the filesets is deleted through the UI
NOTES
ref: https://docs.google.com/document/d/1QPeT3bLHQkWWkhX5SQ9Pntgtlm-bqlUxoz5E5Xt1tRI/edit