Repository navigation
Show the digital files a reader cannot open yet, with the reason - #50
Conversation
Pinakes 0.8.6 decides who may open each digital file (fabiodalez-dev/Pinakes#480) and tells the app per file: a closed one keeps its entry with url null and access login_required or loan_required. The detail page now keeps that card, with a lock and the reason ("For readers who have this book on loan", "Sign in to open it") in place of the button, in the four languages. Closed files all arrive with the same empty address, so the list no longer folds them into one: only the open files are told apart by their address. Servers before 0.8.6 send neither field and every file stays open, as before. The links to the files the reader may open are signed and last a day. A tap on one that has expired fetches the record again for a fresh link and asks to tap again, instead of opening a file the server would refuse.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues. There are two rough edges in the expired-link path, both inline.
Reviewed changes
I reviewed the initial commit, which adds client support for Pinakes 0.8.6 per-file digital access (fabiodalez-dev/Pinakes#480).
- Access-aware
DigitalAttachment: new nullablevisibility/accessfields, alockedflag, andpk_expparsing for signed-link expiry. Older servers send neither field, so their files stay open. digitalFilesdedup: locked files with an emptyurlare kept. Only open files are deduplicated by address.- Locked card UI:
LockedDigitalFileshows a lock and the reason (login or loan) in place of the Read/Play button. - Expired-link refresh: tapping a signed link that is about to expire reloads the record and asks the reader to tap again.
- i18n: four new keys in all of
en/it/fr/de, with no em dashes. - Tests: three Robolectric tests cover closed cards, pre-0.8.6 servers and an expired link.
claude-opus-5-5 | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues. Both earlier findings are fixed. One minor suggestion inline, about audio playback.
Reviewed changes
I reviewed 1568f7d, which reworks how signed links are renewed after the previous review.
- Server-side renewal on every tap: removed
linkExpired. Any file with apk_expis now revalidated with the server and opened in the same tap, so a wrong device clock can no longer cause a refresh loop. - In-place refresh: added
BookDetailViewModel.refreshDigitalFile. On success it replacescontentwithout aLoadingstep. A failure leaves the page as it was, and a missing or locked match comes back asFORBIDDEN. - Cache bypass:
CatalogRepository.book(forceRefresh = true)dropsIf-None-Match, sendsCache-Control: no-cache, no-store, and never falls back to the cached payload or a 304. - File identity: added
DigitalAttachment.resourceKey, which strips only the signature parameters, so a renewed file is matched to its old entry even when the server reorders or renames entries. - Tap handling: a pending renewal disables every open button and shows loading on the tapped one. Audio no longer starts from the legacy
book.audioUrl. - i18n/tests: replaced
digital_link_refreshedwithdigital_link_refresh_errorin all four locales. AddedDigitalLinkRefreshTest(Robolectric) andDigitalLinkRefreshFlowTest(instrumented, MockWebServer).
claude-opus-5-5 | 𝕏
Renewing any file swaps in a record whose URLs are all re-signed, so the player, matched to its card by the full signed URL, left composition and stopped. The started file is now remembered and matched by resourceKey, and the player keeps the URL it started with.
There was a problem hiding this comment.
✅ No new issues found. The audio playback finding from the last review is fixed.
Reviewed changes
I reviewed 2784ecd, which keeps a playing audiobook running when another file of the record is renewed.
- Audio identity:
selectedAudionow holds the startedDigitalAttachment, not its URL. The newplayingAudioUrl()matches the card byresourceKeyand returns the started URL, which feeds bothAudioPlayerand itskey. Re-signing every URL on a renewal therefore no longer stops or restarts playback. If the audio file becomes locked, thefile.lockedbranch still takes over first. - Tests: added
PlayingAudioUrlTest, which covers a re-signed audio URL, a different file, and the case with no selection.
claude-opus-5-5 | 𝕏

Pinakes 0.8.6 decides who may open each digital file (fabiodalez-dev/Pinakes#480) and says so per file in the book detail: a file the reader may not open yet keeps its entry, with
url: nullandaccessset tologin_requiredorloan_required.Verification
testDebugUnitTest: 401 passed, no failures or skips.testReleaseUnitTest: 401 passed, no failures or skips.DigitalLinkRefreshFlowTestinstrumented tests pass on a separate disposable Android 15 emulator, including fresh-cache bypass, HTTP 503/500, unexpected 304, retry, reordered/renamed files and revoked access.lintDebug: 0 errors (120 warnings).