Can't resume a book in Panels that was started in Komga

Hello Panels devs,

I remember seeing some discussion around the ability to resume a book from Komga through OPDS using the pse:lastRead="10" property in the OPDS feed. I remember seeing the release notes that mentionned this, and the discussion on komga#737. Since the latest release of Panels now reports back read progress to Komga, I was excited to try Panels out again, as it was a feature that I really wanted, as to not have to mark stuff manually as read.

However, whenever I try to open a book, say from the “Keep reading” folder of the OPDS feed, the books always open on page 1, even if it has the lastRead property on the OPDS feed.

For example:

    <link href="/opds/v1.2/books/03KMX9PBZTVMP/pages/{pageNumber}?zero_based=true" xmlns:wstxns2="http://vaemendis.net/opds-pse/ns" wstxns2:count="114" wstxns2:lastRead="27" type="image/jpeg" rel="http://vaemendis.net/opds-pse/stream"/>

Was this feature somehow broken/removed/disabled in the meantime?

I’d love to get this working, so Panels will feel like a native Komga client, even though it uses OPDS!

Thanks in advance

1 Like

could you install the latest Testflight and let us know if it works for you now ?

I just tried the latest TestFlight build, I still have the same problem. To be clear, read progress Panels → Komga works for be, but read progress Komga OPDS → Panels using the lastRead xml prop doesn’t.

Support Info:
Version: 2.14.0 Build: 202301272147 Env: Production (Testflight)
Support Identifier:
F33ABA71-EAA2-43F3-BC9D-512109D98F21

Ok, this should be fixed in the next Testflight (currently uploading it).

The problem with lastRead is that some servers or server versions are not respecting the pse: prefix anymore.
Panels is looking for pse:lastRead and the feed is returning wstxns2:lastRead. This causes the acquisition time to have a nil lastRead and default to the first page.

Same happens with pse:count. We already had a workaround patch to first look for pse:count and fallback to [WHATEVER]:count. I just extended this behavior to lastRead.

The new Testflight should be available in a few minutes.
Give it a try and let us know if it works.

I just tried the latest build, it works!! :tada:

For reference, here is a comment by gotson (maintainer of Komga) on an issue I made in another project, again related to the OPDS feed: Bug: OPDS-PSE doesn't work with Komga · Issue #8978 · koreader/koreader · GitHub

In short, the correct prefix for the count and lastRead is also defined in the same xml element with a

<link … xmlns:[prefix]="http://vaemendis.net/opds-pse/ns" … />

to specify that those props are from the OPDS PSE spec.

But your implementation of searching for "*:lastRead" also gets the job done perfectly fine :stuck_out_tongue:

Thanks a lot for the quick fix!

1 Like

Ohhhh I see! Got it!

I’m not super familiar with XML standards. It’s a bit counterintuitive to me. I would expect the prefix to be a value of the attribute, not part of the key :confused:

Thank you so much for the insight. I’ll tweak the implementation to find the prefix that way. It feels much better than a wildcard :sweat_smile:

2 Likes

You’re welcome! Do note that the prefix can be defined either on the <link> element directly, or just once on the <feed> element for example. I don’t know how the other OPDS servers define it (ex kavita or codex), but I know it’s something to look out for.

Follow-up question then concerning the usage of the lastRead property: is it correct to assume that it is used exactly once, when Panels first opens the book? After that the book is in Panels’ database and it handles read progress from that point forward, to ensure cross device progress sync works, mainly. Correct?

Just to be sure that the scenario read in Komga → continue in Panels → continue in Komga → continue in Panels isn’t currently supported.

1 Like

Thanks for the heads up. I will take it into account :+1:

The current Panels version doesn’t handle that workflow correctly, but the next one will. We are now pulling the current read progress from Komga’s API. If we can’t fetch the current progress from Komga’s API, our you are using any other server, we use lastRead.

I’ve tested this workflow with 3 different devices + Komga web reader, and progress works as you would expect.

I’ll probably submit another testflight in a few hours, including the lastRead rewrite to use the namespace from xmlns:[prefix]="http://vaemendis.net/opds-pse/ns", and some other fixes in the reader.

Give it a try when it’s ready and let us know if you find any problems with the streaming progress sync

2 Likes

I just tested this and it seems to be working. Thanks!

2 Likes

If the new build that looks for the correct namespace is
Version: 2.14.0 Build: 202301281835

I confirm that it works!

The current Panels version doesn’t handle that workflow correctly, but the next one will.

That’s excellent news! I’m happy to know that the feature is being implemented. I’ll be awaiting that release! :grin:

Thanks for all the hard work to make Panels an amazing reader :ok_hand:

2 Likes

2 posts were split to a new topic: Komga reading progress sync