diff --git a/CLAUDE.md b/CLAUDE.md index 51be7e7..fc0f199 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,6 +26,55 @@ To remove the scheduled task: Unregister-ScheduledTask -TaskName "MediaServer" -Confirm:$false ``` +## Development Workflow + +### Server Restart After Code Changes + +**CRITICAL:** When making changes to backend code (Python files, API routes, service logic), the media server MUST be restarted for changes to take effect. + +**When to restart:** + +- Changes to any Python files (`*.py`) in the media_server directory +- Changes to API endpoints, routes, or request/response models +- Changes to service logic, callbacks, or script execution +- Changes to configuration handling or startup logic + +**When restart is NOT needed:** + +- Static file changes (`*.html`, `*.css`, `*.js`, `*.json`) - browser refresh is enough +- README or documentation updates +- Changes to install/service scripts (only affects new installations) + +**How to restart during development:** + +1. Find the running server process: + + ```bash + # Windows + netstat -ano | findstr :8765 + + # Linux/macOS + lsof -i :8765 + ``` + +2. Stop the server: + + ```bash + # Windows + taskkill //F //PID + + # Linux/macOS + kill + ``` + +3. Start the server again: + + ```bash + python -m media_server.main + ``` + +**Best Practice:** Always restart the server immediately after committing backend changes to verify they work correctly before pushing. + ## Configuration Copy `config.example.yaml` to `config.yaml` and customize.