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.77k stars 153 forks source link

OPDS 1.2 pagination is not working #1977

Open gotson opened 1 year ago

gotson commented 1 year ago

Related: https://github.com/edrlab/thorium-reader/issues/462

I was testing Thorium with an OPDS 1.2 catalog, and noticed that the pagination does not always work.

Here is an example of feed that shows pagination (entries truncated for brievity):

<feed xmlns="http://www.w3.org/2005/Atom">
    <id>06X48XVKS54T7</id>
    <title>Fables - Complete Reading Order</title>
    <updated>2022-08-11T11:08:46.389+08:00</updated>
    <author>
        <name>Komga</name>
        <uri>https://github.com/gotson/komga</uri>
    </author>
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="self"
        href="/opds/v1.2/readlists/06X48XVKS54T7" />
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start" href="/opds/v1.2/catalog" />
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="next"
        href="/opds/v1.2/readlists/06X48XVKS54T7?page=1" />
    <entry>
        <title>Fables 1: Legends in Exile</title>
        <updated>2023-06-27T23:20:56.929+08:00</updated>
        <id>60173</id>
        <content>cbz - 227.8 MiB</content>
        <link type="image/jpeg" rel="http://opds-spec.org/image/thumbnail"
            href="/opds/v1.2/books/60173/thumbnail/small" />
        <link type="image/jpeg" rel="http://opds-spec.org/image" href="/opds/v1.2/books/60173/thumbnail" />
        <link type="application/zip" rel="http://opds-spec.org/acquisition"
            href="/opds/v1.2/books/60173/file/Fables%20Vol.%2001%20-%20Legends%20in%20Exile%20(2002)%20(Digital%20TPB)%20(Nahga-Empire).cbz" />
        <link href="/opds/v1.2/books/60173/pages/{pageNumber}?zero_based=true"
            xmlns:wstxns1="http://vaemendis.net/opds-pse/ns" wstxns1:count="126" wstxns1:lastRead="127"
            wstxns1:lastReadDate="2021-11-28T11:07:08Z" type="image/jpeg" rel="http://vaemendis.net/opds-pse/stream" />
    </entry>
</feed>

Here is an example of feed that doesn't show pagination (entries truncated for brievity):

<feed xmlns="http://www.w3.org/2005/Atom">
    <id>allSeries</id>
    <title>All series</title>
    <updated>2023-08-22T11:25:20.675527698+08:00</updated>
    <author>
        <name>Komga</name>
        <uri>https://github.com/gotson/komga</uri>
    </author>
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="self" href="/opds/v1.2/series" />
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start" href="/opds/v1.2/catalog" />
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="next" href="/opds/v1.2/series?page=1" />
    <entry>
        <title>1602</title>
        <updated>2021-05-31T10:45:02.7Z</updated>
        <id>055402QY95F07</id>
        <content></content>
        <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="subsection"
            href="/opds/v1.2/series/055402QY95F07" />
    </entry>
</feed>

I am using Thorium v2.2.0 on macOS 13.5

danielweck commented 1 year ago

hello, did you test with Thorium 2.3.0? (I don't think the outcome will differ from 2.2.0, but just in case)

relevant code: https://github.com/edrlab/thorium-reader/blob/develop/src/renderer/library/components/opds/PageNavigation.tsx

https://github.com/edrlab/thorium-reader/blob/a9630b9ac64e8d4ed3db7443c9255f2715dc8e34/src/renderer/library/components/opds/EntryPublicationList.tsx#L56

gotson commented 1 year ago

Hi @danielweck , in v2.3.0 it works for acquisition feeds, but not navigation feeds.

The above example now works, however this does not:

<feed xmlns="http://www.w3.org/2005/Atom">
    <id>allSeries</id>
    <title>All series</title>
    <updated>2023-08-23T16:26:23.009768338+08:00</updated>
    <author>
        <name>Komga</name>
        <uri>https://github.com/gotson/komga</uri>
    </author>
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="self" href="/opds/v1.2/series"/>
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start" href="/opds/v1.2/catalog"/>
    <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="next" href="/opds/v1.2/series?page=1"/>
    <entry>
        <title>1602</title>
        <updated>2021-05-31T10:45:02.7Z</updated>
        <id>055402QY95F07</id>
        <content></content>
        <link type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="subsection"
              href="/opds/v1.2/series/055402QY95F07"/>
    </entry>
</feed>

And the result in Thorium:

image
panaC commented 4 months ago

related to #2057