mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
The app could show a server-side playlist and nothing else. Editing was never the missing part on its own: nothing on screen knew whose playlist it was looking at, and without an owner there is no credential to fetch it with, no row identity to remove by, and nobody to send a change to. So the destination carries the account. Only Invidious ids hint at ownership — the IVPL prefix — and that heuristic stays for links that arrive from elsewhere; a Piped playlist looks exactly like any other, so the places that already know whose list a row came out of now say so. An owned playlist is then fetched authenticated, which is both the only way to see a private one and the only way to learn what the server calls its rows. A playlist read from the public endpoint has no row identities at all, and that is precisely why nothing about it may be changed: the edit affordances appear over the authenticated snapshot or not at all. Rows are paired with entries by walking the two lists together rather than by index. Entries are a subsequence — a row the server declined to name is still displayed, it just can never be a target — and matching on the video alone would be wrong too, since a playlist may hold the same video twice and each copy is its own row. Every change goes through the cache, so the refetch that reconciles it cannot be skipped, and what the view shows afterwards is only ever what came back. That includes the failures: a removal aimed at a row that has since moved says so specifically, over a list that has already been refreshed. Adding a video now offers every account that can be written to, on every instance rather than the selected one alone — this is not a browsing decision. Those rows never claim the video is already there: the list fetch does not carry a playlist's videos, so membership is unknowable from here, and a duplicate is the server's business. Capabilities decide throughout, never the instance type, which is what finally lets a Piped login list and edit its playlists in the browse tab beside an Invidious one — and what keeps the visibility picker away from a backend that has no such setting. Handoff leaves the account out of its payload deliberately. It assembles its userInfo key by key, so the added value changes nothing about the coding either way, but an account is only usable on a device holding its credential — the receiving device resolves ownership for itself.