readium/r2-opds-js

Converter error (navigation instead of publication from entries links)

danielweck opened this issue · 6 comments

https://readium2.herokuapp.com/opds12/http%3A%2F%2Fwww.feedbooks.com%2Fstore%2Ftop.atom

 Entries: [ { Title: "Marked By the Wolf #1: Werewolf Shifter Romance", Authors: [ { Name: "Mac Flynn", Uri: "http://www.feedbooks.com/search?query=contributor%3A%22Mac+Flynn%22" } ], Id: "http://www.feedbooks.com/item/2429738", Summary: "Danica “Danny” Lewis wanted something more in life. She wanted a boyfriend, riches, or at least to get out of her office job. She got all she bargained for, and a fur coat when she falls into the clutches of a pack of organized werewol...", DcLanguage: "en", DcExtent: "183 KB", DcPublisher: "Crescent Moon Studios, Inc.", DcIssued: "2017-07-10", DcIdentifier: "urn:ISBN:9788826465425", DcIdentifierType: "dcterms:URI", Categories: [ { Term: "FBFIC000000", Scheme: "http://www.feedbooks.com/categories", Label: "Fiction" }, { Term: "FBFIC027000", Scheme: "http://www.feedbooks.com/categories", Label: "Romance" }, { Term: "FBFIC027120", Scheme: "http://www.feedbooks.com/categories", Label: "Paranormal" }, { Term: "FBFIC027020", Scheme: "http://www.feedbooks.com/categories", Label: "Contemporary" }, { Term: "FBFIC027030", Scheme: "http://www.feedbooks.com/categories", Label: "Fantasy" }, { Term: "FBFIC009000", Scheme: "http://www.feedbooks.com/categories", Label: "Fantasy" } ], Updated: "2018-01-10T14:54:25.000Z", Published: "2017-07-12T07:09:55.000Z", Links: [ { Type: "text/html", Href: "http://www.feedbooks.com/item/2429738", Title: "View on Feedbooks", Rel: "alternate" }, { Type: "image/jpeg", Href: "http://covers.feedbooks.net/item/2429738.jpg?size=large&t=1512052718", Rel: "http://opds-spec.org/image" }, { Type: "image/jpeg", Href: "http://covers.feedbooks.net/item/2429738.jpg?t=1512052718", Rel: "http://opds-spec.org/image/thumbnail" }, { OpdsPrice: "0.00", OpdsPriceCurrencyCode: "EUR", OpdsIndirectAcquisitions: [ { OpdsIndirectAcquisitionType: "application/epub+zip" } ], Type: "text/html", Href: "https://www.feedbooks.com/item/2429738/buy", Rel: "http://opds-spec.org/acquisition/buy" }, { Type: "application/atom+xml;type=entry;profile=opds-catalog", Href: "http://www.feedbooks.com/item/2429738.atom", Title: "Full entry", Rel: "alternate", __href__: "https://readium2.herokuapp.com/opds12/http%3A%2F%2Fwww.feedbooks.com%2Fitem%2F2429738.atom" } ] },
...

==>

navigation: [ { href: "http://www.feedbooks.com/item/2429738", type: "text/html", title: "Marked By the Wolf #1: Werewolf Shifter Romance", rel: "alternate" },

In Go, this is a test against a regex, while in TypeScript it looks like an exact match.
That's probably the source of this problem.

Bug: "http://opds-spec.org/acquisition/buy" is not detected, only "http://opds-spec.org/acquisition"

Yes @HadrienGardeur I spotted that too :)
Thanks for the bug report !

Fixed here: 9712214

I will close the issue once the TravisCI build is deployed at https://readium2.herokuapp.com

Test link for bugfix verification:
https://readium2.herokuapp.com/opds12/http%3A%2F%2Fwww.feedbooks.com%2Fstore%2Ftop.atom