Optimize desktop launcher for silent startup and restore server URL detection

This commit is contained in:
ComputerTech 2026-01-20 17:17:57 +00:00
parent c9fc389d94
commit 19f6726a33
1 changed files with 12 additions and 18 deletions

View File

@ -101,10 +101,6 @@ if [ $MISSING_DEPS -eq 1 ]; then
echo "✅ Dependencies installed successfully!" echo "✅ Dependencies installed successfully!"
fi fi
# Check if Flask server is running
echo ""
echo "Checking Flask server..."
# Try to read server URL from settings # Try to read server URL from settings
SERVER_URL="http://localhost:5000" SERVER_URL="http://localhost:5000"
SETTINGS_FILE="$HOME/.techdj_settings.json" SETTINGS_FILE="$HOME/.techdj_settings.json"
@ -125,25 +121,23 @@ if [ -f "$SETTINGS_FILE" ]; then
fi fi
fi fi
# Check if Flask server is running
echo "Checking server at: $SERVER_URL" echo "Checking server at: $SERVER_URL"
if curl -s --max-time 5 "${SERVER_URL}/library.json" > /dev/null 2>&1; then if curl -s --max-time 2 "${SERVER_URL}/library.json" > /dev/null 2>&1; then
echo "✅ Flask server is running at $SERVER_URL" echo "✅ Flask server is running at $SERVER_URL"
else else
echo "⚠️ Flask server not detected at $SERVER_URL" echo "⚠️ Flask server not detected at $SERVER_URL"
echo "Please make sure the server is running." if [[ "$*" == *"--noint"* ]]; then
echo "" echo "Proceeding in non-interactive mode..."
echo "For local server:" else
echo " python3 server.py" echo "Please make sure the server is running."
echo "" echo ""
echo "For remote server:" read -p "Continue anyway? (y/n) " -n 1 -r
echo " Make sure server.py is running on the remote machine" echo
echo " and the URL in Settings (⚙️) is correct." if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "" exit 1
read -p "Continue anyway? (y/n) " -n 1 -r fi
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi fi
fi fi