fix(playlists): a reorder counts among the writes, and what the third review found
A reorder was invisible to the overlap bookkeeping: a failed removal reset the screen from a cache without it, and the membership guard never corrects an order. It now counts as a write, a rollback leaves the order to the read after the last write, and the accepted order keeps the rows it does not name, as the server does. Undo places come from the order on screen. A stored position landing during a write reaches the screen, and what a read brought is taken once the refresh is in. A write that went through drops its rows from the cache again, past a read from before it. Closing the player after Trash took the row it opened from no longer strands the focus: the row in that place takes it, else the header's box, else the list's menu. The page menu's grouping row closes its menu when it goes with the view. One hidden row gets its own wording. /search/clear refuses a body without its list.
This commit is contained in:
@@ -314,7 +314,8 @@ def search_youtube(
|
||||
|
||||
|
||||
class ClearSearchIn(BaseModel):
|
||||
video_ids: list[str] = []
|
||||
# Required: a default read a misnamed key as an empty list, a 200 that cleared nothing.
|
||||
video_ids: list[str]
|
||||
|
||||
|
||||
@router.post("/clear")
|
||||
|
||||
@@ -310,6 +310,14 @@ def test_clearing_leaves_a_video_the_caller_never_found(db, make_user, as_user):
|
||||
assert r.json() == {"ok": True, "removed": 0}
|
||||
|
||||
|
||||
def test_clearing_refuses_a_body_without_its_list(db, make_user, as_user):
|
||||
# A misnamed key read as an empty list: 200, and nothing cleared.
|
||||
user = make_user()
|
||||
r = as_user(user).post("/api/search/clear", json={"ids": ["s1"]})
|
||||
assert r.status_code == 422
|
||||
assert as_user(user).post("/api/search/clear", json={"video_ids": []}).status_code == 200
|
||||
|
||||
|
||||
# --- Plex show and season marks ---------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user