mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
09acf955f1
POST /api/model-endpoints always inserted a new row, so Settings -> Add Models -> Scan for Servers re-added any endpoint a user had already registered manually — once under its model name (from the earlier manual add) and again under its host:port (auto-generated when scan posts without a name). The success toast then misreported the result as "added N new". Look up an existing endpoint with the same base_url accessible to the caller (shared or owned by them) before inserting. If found, return it with `existing: true` so the client can tell the difference between an actual add and a dedupe hit. Toast now reads, e.g., "Found 1 server with 1 model — 1 already added". Tested: POSTing the same base_url three times (incl. trailing-slash variation) returns the same id each time; only one row exists.