From e9281818559957c9be2b129de94f6a78f3496a1c Mon Sep 17 00:00:00 2001 From: Nose Date: Wed, 22 Apr 2026 02:23:29 -0700 Subject: [PATCH] updated no more strict port binding for development and preview, added prestart script to build before previewing --- README.md | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 109c353..9599b8b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ npm install npm start ``` -4. Open `http://localhost:4173`. +4. Open the local URL printed in the terminal. By default it starts on `http://localhost:4173`, but it will move to the next free port if that one is already in use. On a fresh install the app opens the Hydrus server settings first. Add your host, port, and API key there, test the connection, then save the server before browsing the library. Playback itself is always external, so actual media launch still depends on the platform-specific player flow below. @@ -117,6 +117,8 @@ http://localhost:4173/userscripts/api-media-player-open-in-mpv.user.js http://127.0.0.1:4173/userscripts/api-media-player-open-in-mpv.user.js ``` +If preview chooses a different port because `4173` is busy, use that same port for the userscript URL too. + It only activates on `localhost`, loopback, RFC1918 LAN IPs, and `.local` or `.lan` hosts. On desktop it redirects to `mpv-handler://...`; on Android it redirects to the `mpv` app through `intent://...`. ## Useful commands diff --git a/package.json b/package.json index b3499e3..7a9bac7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite --host 0.0.0.0", "prestart": "vite build", - "start": "vite preview --host 0.0.0.0 --strictPort --port 4173", + "start": "vite preview --host 0.0.0.0 --port 4173", "build": "vite build", "preview": "vite preview --host 0.0.0.0", "typecheck": "tsc --noEmit",