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!"
fi
# Check if Flask server is running
echo ""
echo "Checking Flask server..."
# Try to read server URL from settings
SERVER_URL="http://localhost:5000"
SETTINGS_FILE="$HOME/.techdj_settings.json"
@ -125,25 +121,23 @@ if [ -f "$SETTINGS_FILE" ]; then
fi
fi
# Check if Flask server is running
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"
else
echo "⚠️ Flask server not detected at $SERVER_URL"
echo "Please make sure the server is running."
echo ""
echo "For local server:"
echo " python3 server.py"
echo ""
echo "For remote server:"
echo " Make sure server.py is running on the remote machine"
echo " and the URL in Settings (⚙️) is correct."
echo ""
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
if [[ "$*" == *"--noint"* ]]; then
echo "Proceeding in non-interactive mode..."
else
echo "Please make sure the server is running."
echo ""
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
fi