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

Two of the open_access_content_url fields are unnecessary and can be removed

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • Server - Core
    • None

      Some old circulation managers have an "editions.open_access_content_url" field in their database which is not present in the ORM. It's likely that this used to be in the ORM, and we removed it from the ORM many years ago without creating a corresponding migration script.

      The licensepools table also has a field called open_access_content_url, which we use as a cache for the somewhat expensive LicensePool.best_open_access_link method. We originally created this because we were putting those open access links into OPDS feeds, and calling best_open_access_link hundreds of times in a row was a big performance hit.

      But, with one minor exception, we no longer call best_open_access_link when generating an OPDS entry for a book – we only call it during the fulfill process, when someone actually tries to download a book. Removing the licensepools.open_access_content_url field would normalize our database and remove a large piece of duplicate data.

      Now, for the minor exception: Work.active_license_pool calls LicensePool.open_access_content_url to verify that a supposedly open-access book actually has an associated URL that we can send the client to. There's a few different ways to improve this, but the simplest one is probably to put the work ID, not the LicensePool ID, into the fulfillment link for open access works. This will defer the "which LicensePool?" decision until after the OPDS feed has been generatedl.

       

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

              Created:
              Updated: