internetarchive / internetarchive/openlibrary
DRY/Fix methods to fetch isbn from work + edition
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
Refactor `get_isbn` and `get_identifiers` methods to standardize the way we get isbns from works and editions. There are likely many ways that an isbn is taken from an `Edition`. There is a method, `Edition:get_identifiers` which looks like it's meant to handle this, but it doesn't appear to do any isbn cleanup or isbn13 to isbn10 transformation. The method seems a little convoluted to me (and it's only used in one other file). It might be best to remove it.
### Summary of requirements
- [ ] Method on `Edition` for getting isbn13s that
- [ ] returns an array of unique strings
- [ ] each string should be a normalized isbn
- [ ] converts any isbn10s to isbn13s
- [ ] Method on `Edition` for getting isbn10s
- [ ] returns an array of unique strings
- [ ] each string should be a normalized isbn
- [ ] converts any isbn13s to isbn10s
- [ ] Method on `Edition` for getting asin
- [ ] returns an array of string
- [ ] Does NOT use isbn10 if ASIN not on the record
- [ ] Anywhere in the templates that checks for isbn13/isbn10/asin should use these methods
- [ ] Any new methods should have tests
- [ ] Any related methods which are no longer used should be deleted
- [ ] Law of refactor: No observable changes (or list what they are)
Contributor guide
Assessment
This issue has not been assessed yet.