Conversation
The Advanced tab form could only create custom sites blind: no list of what exists, no way to fix a missing Main Site binding without hand-editing scrapers.json, no feedback, and unsupported domains were silently dropped. - GET /api/options/custom-sites returns the flat custom-site list - DELETE /api/options/custom-sites removes an entry by URL - PUT /api/options/custom-sites/create now upserts as before but returns the updated list and 400s on unsupported domains - Advanced tab shows existing custom sites with Edit/Delete; editing prefills the form including the Main Site binding - restart is still required (custom scrapers register at startup and InitSites applies the binding on boot)
Re-reads scrapers.json on demand: new custom sites register and edited entries (rebinds, renames) re-register in place with a fresh scrape closure, then Site rows are synced via InitSites. Entries deleted from the file stay registered until restart. - models.ReregisterScraper: replace-by-ID or append; GetScraperByID - scrape.ReloadCustomScrapers + POST /api/options/custom-sites/reload - the six addXxxScraper helpers use the reregister wrappers, which is identical at startup (empty registry) and enables live replacement - Advanced tab Reload button with added/updated counts in the toast
POST /api/options/custom-sites/reload was sent bodyless, but the
options WebService Consumes(application/json), so go-restful rejected
it with 415 before the handler ran. Send {} from the UI and accept */*
on the route (same pattern as inconsistencies fixAll).
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.
The Custom Sites form under Settings > Advanced could only create sites blind: no list of what exists, no way to fix a forgotten Main Site binding without hand-editing scrapers.json, no feedback, and unsupported domains were silently dropped. And every change needed a restart.
This adds, in two commits:
List, edit and delete from the UI
Reload without restart
Verification