Uploaded image for project: 'SimplyE 2.0'
  1. SimplyE 2.0
  2. SIMPLY-1485

Automatically mark works for presentation recalculation when a component edition changes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 2.2.12cm
    • None
    • None
    • S24 SIMPLY Nov 15 - Nov 28

      OPDSImporter.update_work_for_edition is called after we import new metadata for a work (e.g. from the metadata wrangler). It finds a LicensePool for the book and calls calculate_work() on the LicensePool's Work. This ensures that whenever we get new metadata,

      But an OPDS import from the metadata wrangler isn't the only source of new metadata. It can happen from the new Bibliotheca circulation sweep. It can happen because of a one-off intervention like one recently done on some Enki collections. I'd like this to happen even more often, in fact – it would be great if we could periodically refresh a book's Overdrive metadata to get real book covers instead of "preorder now" placeholders. But when this happens, the presentation doesn't get recalculated. I've been resolving this with one-off code like that in https://github.com/NYPL-Simplified/circulation/pull/1126/files/b21cd75711cfe7deb38f6210bf87df03b83ed42e#diff-a9175307ab5f6aaa1d05340b8c03bce7R1228

      We need a general solution. It might be so general as to go into Metadata.apply() – every time we add metadata to an Edition, we check if there's an affected Work and if so, we mark it for presentation recalculation. Or maybe each individual source of metadata should decide for itself.

      While we do this we could also change update_work_for_edition so that if a Work already exists, it marks the work for presentation calculation rather than doing the calculation immediately. This would dramatically speed up OPDS imports from the metadata wrangler, at the cost of having the metadata changes themselves show up later than they otherwise would.

      In any event, I want to make sure that presentation is always calculated immediately upon a work's initial creation – that shouldn't wait.

            leonardrichardson Leonard Richardson [X] (Inactive)
            leonardrichardson Leonard Richardson [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: