Skip to content
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

Lending requests may sometimes need additional param 'filename_base' #245

Open
judec opened this issue Oct 17, 2022 · 1 comment
Open

Lending requests may sometimes need additional param 'filename_base' #245

judec opened this issue Oct 17, 2022 · 1 comment

Comments

@judec
Copy link

judec commented Oct 17, 2022

'identifier': ocaid,

Most lendable items on archive.org have a filename_base that matches the identifier. For example, a book with the identifier "foo" will have files named "foo.pdf" inside the item. This is the case with all books that we digitize ourselves. Additionally, Adobe ACS was never set up to support items that had a different naming scheme, so before LCP, those items ended up not being lendable via downloadable file (or I should say, the ACS encryption supported it, but the UI and possible endpoints were never updated to support it).

However, the LCP code supports any files inside the item. As an example, there is an item with the identifier isbn_9781849353496 which contains files starting with the base luigi_galleani__the_most_dangerous_anarchi_-_antonio_senta. To create a loan for these items, you must supply the filename_base param IN ADDITION TO the identifier param in the lending endpoint URL.

Note: the loan will apply to the entire item, not just individual files.

Luckily, there is an easy way to get the filename_base (and to know if it is different). It appears as part of the associated urn for the lendable file in the external-identifier field of item metadata (which should also be in search engine, and can be added to bulk availability API if it is not already).

So, in the item above, the external identifier field looks like this:

[
"urn:acs6:luigi_galleani__the_most_dangerous_anarchi_-antonio_senta:epub:ba89796d-5672-40ac-a010-eca9555ac151",
"urn:acs6:luigi_galleani__the_most_dangerous_anarchi
-antonio_senta:pdf:c48a2b01-e908-45e9-ba7b-d1b345a05d39",
"urn:lcp:luigi_galleani__the_most_dangerous_anarchi
-antonio_senta:epub:96ffd35e-5979-47a3-a76c-045e11240f7a",
"urn:lcp:luigi_galleani__the_most_dangerous_anarchi
-_antonio_senta:lcpdf:451332ca-7112-4f12-b0c2-c9582143bebc"
]

And so you can see that the filename base is the third item in the urn if split by ":".

@bfalling
Copy link

bfalling commented Feb 16, 2023

This is addressed in the Archive.org back-end, so this ticket can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants