edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.74k stars 152 forks source link

OPDS 2 facets are not displayed #1980

Closed gotson closed 1 year ago

gotson commented 1 year ago

I have an issue where facets are not displayed, even though it seems it should be handled according to the changelog from older versions.

I am testing with v2.3.0.

Here is the feed:

{
  "metadata": {
    "title": "Library",
    "modified": "2023-08-22T14:07:10+08:00",
    "itemsPerPage": 2,
    "currentPage": 0,
    "numberOfItems": 17
  },
  "links": [
    {
      "rel": "self",
      "href": "/opds/v2/libraries/0DBTWY634KNPP"
    },
    {
      "title": "Home",
      "rel": "start",
      "href": "/opds/v2/catalog"
    },
    {
      "rel": "next",
      "href": "/opds/v2/libraries/0DBTWY634KNPP?page=1"
    }
  ],
  "navigation": [
    {
      "title": "300",
      "href": "/opds/v2/series/0DBTWY6BRKMMP",
      "type": "application/opds+json"
    },
    {
      "title": "Animosity",
      "href": "/opds/v2/series/0DBTWY6Z0KN3J",
      "type": "application/opds+json"
    }
  ],
  "facets": [
    {
      "metadata": {
        "title": "Publisher"
      },
      "links": [
        {
          "title": "AfterShock Comics",
          "href": "/opds/v2/libraries/0DBTWY634KNPP?publisher=AfterShock%20Comics",
          "type": "application/opds+json"
        },
        {
          "title": "Boom! Studios",
          "href": "/opds/v2/libraries/0DBTWY634KNPP?publisher=Boom!%20Studios",
          "type": "application/opds+json"
        },
        {
          "title": "Image",
          "href": "/opds/v2/libraries/0DBTWY634KNPP?publisher=Image",
          "type": "application/opds+json"
        }
      ]
    }
  ]
}

And here is what Thorium displays:

image
danielweck commented 1 year ago

hello, 'facets' are to be used alongside the 'publications' collection in the feed, not 'navigation' or 'group'.

relevant code: https://github.com/edrlab/thorium-reader/blob/a9630b9ac64e8d4ed3db7443c9255f2715dc8e34/src/renderer/library/components/opds/BrowserResult.tsx#L93

specification: https://drafts.opds.io/opds-2.0.html#14-facets

JSON schema: https://github.com/opds-community/drafts/blob/061e138b443be91fcfef55d3f36d31075958af46/schema/feed.schema.json#L67

gotson commented 1 year ago

My bad, thanks for the clarification.