Repository navigation
Episode page: back link returns to the list it came from - #22
Merged
Merged
Conversation
The link now uses the show's list URL (view, downloaded/grabbed narrows, search) taken from the Referer when the page was reached from that show's episode list, and falls back to the show page otherwise. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JSf3yWtWAcbkWcXbKkgwMh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The back link on the episode page always went to the plain show page, dropping the list view, Downloaded/Grabbed toggles and search the user had set. It now returns to the list as they left it.
How it works
list_return_url()inpodblock/web/routes/podcasts.pyreads theRefererheader (the app already sendsReferrer-Policy: same-origin). When it is this show's episode list, it rebuilds the list URL (view, narrows,q) with the existing_list_url(). Thepagenumber is dropped, so the list opens at the top.show_episodepasses the result toepisode.htmlasback./podcasts/{id}when there is no Referer, it is from another site or show, or it is one of the show's other tabs (Private feed, Filters, Settings).fromparameter on each row link, because the polled/episodes/{id}/rowrefresh would have lost the parameter.Known limit
After saving timeline edits, the redirect back to the episode has the episode page as its Referer, so the back link goes to the plain show page.
Testing
test_back_to_the_show_keeps_the_list_it_came_fromcovering the cases above.tests/test_podcast_pages.pyre-run: 27 passed.ruff check .is clean.Generated by Claude Code