Princeton-CDH / ppa-django

Princeton Prosody Archive v3.x - Python/Django web application
http://prosody.princeton.edu
Apache License 2.0
4 stars 2 forks source link

revise Gale image URLs handling (use image urls from Gale API) #661

Closed jerielizabeth closed 1 month ago

jerielizabeth commented 1 month ago

Previously our Gale image display template code used a hard-coded image server base url in combination with the image id. With Gale's shift to encrypted image urls, we need to index the full image url and use that instead. The syntax for image format and sizing should still work.

testing notes

There shouldn't really be any visible change with this, but you can confirm that we're pulling images from the new image server based on the urls. The image server hostname is luna.gale.com (previously callisto.ggsrv.com) and there's now a very long alphanumeric encrypted identifier instead of the shorter numeric ids we had before.

mnaydan commented 1 month ago

@rlskoeser unfortunately the Gale images are not displaying. Here are some screenshots of how it appears on the main search and detail pages respectively. This is happening for CB and CW works, and both clustered and unique works. HathiTrust images display as expected.

Screenshot 2024-08-14 at 9 03 40 AM Screenshot 2024-08-14 at 9 03 56 AM

rlskoeser commented 1 month ago

@mnaydan I suspect that this is because it's been a while since I indexed the pages - maybe they've started using the encryption and rotation. I'll reindex the Gale pages and see if it resolves this.

rlskoeser commented 1 month ago

@mnaydan completed reindexing Gale pages in staging, would you check and see if this resolves what you were seeing? (I checked one or two volumes individually but having trouble finding missing page images in the search)

mnaydan commented 1 month ago

@rlskoeser they're still broken on the main search page but are now appearing on the volume detail search page! Here's a sample search if you scroll down a couple: https://test-prosody.cdh.princeton.edu/archive/?query=rhythmic&pub_date_0=1700&pub_date_1=1758&collections=9&collections=10&collections=3&collections=4&collections=0&sort=relevance

rlskoeser commented 1 month ago

Ah! wow, ok, that's helpful - obviously some kind of code issue if it works in one place and not the other. Thanks!

rlskoeser commented 1 month ago

🤦‍♀️ I was passing the wrong variable to the page preview template (a non-existent item.image_url instead of page.image_url). It should be fixed now.

mnaydan commented 1 month ago

@rlskoeser it looks fixed now!