Repository navigation
Manage overrides in the web interface - #25
Merged
Merged
Conversation
InvalidError gains a Field: titles, id, seasons, episodes, or a film's title or year, and none if the override as a whole is at fault. Reason gives the message without the field's name. The web interface's forms use both to show a refusal beside the input it is about. The API's messages are unchanged.
A new Overrides page lists each site's overrides, with forms to add, change and remove them for series and films. A series' form has its titles to search, the site's ID or page address, season rules and pinned episodes; a film's has Radarr's title and year, titles and the ID. Titles, rules and pins are rows of inputs. Their Add and Remove buttons submit the form, which comes back changed but unsaved, so no script is needed. A hidden first submit button keeps Enter saving rather than adding a row. A form that can't be saved comes back with status 422 and each message beside its field, and focus goes to the first one. The form checks what the store can't see: numbers that aren't numbers, half-filled rows, an episode pinned twice. The store's refusals follow. Adding an override for a series or film that has one is refused with a link to it, where the API's PUT would replace it. htmx focuses the first autofocus input after every swap, so a form's page refreshes only its header, from the new /ui/topbar, and leaves what is typed alone. Saving returns to the list at the saved row, which is highlighted.
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.
Adds an Overrides page to the web interface, so corrections to matching no longer need
curl.PUTstill replaces.Titles, rules and pins are rows whose Add and Remove buttons submit the form, which comes back changed but unsaved, so there is no new script and the forms work without JavaScript. The form checks what the store can't see (numbers, half-filled rows, an episode pinned twice); the store's refusals follow, placed by the new
InvalidError.Field. The API's messages are unchanged.htmx focuses the first
autofocusinput after every swap, so a form's page refreshes only its header, from a newGET /ui/topbar, and leaves what is typed alone. Tab counts on a form's page stay as they were when it loaded.Tested:
make test; Playwright checks in Chromium of adding and removing rows, focus after each, inline errors, saving with Enter, the duplicate refusal, editing, removing from the list and from the form, a film title with a slash, and that the header refresh leaves the form and focus alone; screenshots of the list, both forms, errors and confirmations in light and dark at desktop and phone widths; the real binary by hand; Codex review.