Skip to content

Redirect /medialist/<media_type> to the user's own media list - #1804

Open
julienbeugras wants to merge 1 commit into
FuzzyGrim:devfrom
julienbeugras:pwa-shortcut-redirects
Open

julienbeugras wants to merge 1 commit into
FuzzyGrim:devfrom
julienbeugras:pwa-shortcut-redirects

Conversation

@julienbeugras

@julienbeugras julienbeugras commented Nov 6, 2026 •

Copy link
Copy Markdown

Closes #1460

Since #1251 media lists live at /<username>/<media_type>, but the PWA shortcuts in static/favicon/site.webmanifest still point to /medialist/<media_type>, so every media shortcut opens a 404. Bookmarks from before #1251 break the same way.

Changes

  • New route medialist/<media_type> (own_medialist), placed before <username>/<media_type>, handled by views.own_media_list:
    • a logged-in user is redirected to /<their username>/<media_type>, with the query string kept (?status=Completed from an old bookmark still applies);
    • an anonymous visitor is sent to login with next=/medialist/<media_type>, then lands on their own list;
    • if a user is actually named medialist, the view serves their list as before, so the new route takes nothing away from an existing account.
  • The manifest is unchanged: its shortcuts are generic, and this keeps them that way rather than needing a per-user manifest.

Tests

OwnMediaListRedirectTests: the redirect for every media type, query string kept, anonymous user sent to login, a user named medialist keeps their list, and every shortcut URL in site.webmanifest opens with a 200 when followed, so a shortcut that stops resolving fails the suite. All but the medialist-user case fail against dev.

app (excluding live provider tests), users, lists and events pass, as do ruff check src, ruff format --check src and the pre-commit hooks. I couldn't complete the integrations suite locally: the Goodreads import test was rate-limited by the live API (asked to wait ~4 hours), which is unrelated to this change. Also checked on a local instance that an anonymous request to /medialist/tv is sent to login with next=/medialist/tv.

Since FuzzyGrim#1251 media lists live at /<username>/<media_type>, but the PWA
shortcuts in site.webmanifest still point to /medialist/<media_type> and
open a 404 (FuzzyGrim#1460). Older bookmarks break the same way.

/medialist/<media_type> now redirects the logged-in user to their own
list, keeping the query string, and sends anonymous visitors to login
first. A user actually named "medialist" keeps their list at that URL.

A test opens every shortcut in the manifest, so a shortcut that stops
resolving fails the suite.

Closes FuzzyGrim#1460

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] #1251 broke PWA shortcuts

1 participant