diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-09 11:11:49 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-09 11:11:49 +0300 |
| commit | 8c32cd117abe79f4ee6cff3a950ffc35c95faeff (patch) | |
| tree | 5b63a4789351da4f2d9c1cd2e7007f67d43b3371 /start.sh | |
| parent | 59c8870061465142306e7a6e5d3fcb344686cfe9 (diff) | |
Refine media browsing and set covers
Diffstat (limited to 'start.sh')
| -rwxr-xr-x | start.sh | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -40,6 +40,36 @@ bootstrap_auth() { -c "$COOKIE" > /dev/null 2>&1 || true } +launch_chromium() { + CHROMIUM_BIN="" + for c in chromium chromium-browser google-chrome google-chrome-stable; do + if command -v "$c" >/dev/null 2>&1; then + CHROMIUM_BIN="$c" + break + fi + done + if [ -z "$CHROMIUM_BIN" ]; then + echo "Chromium not found in PATH; skipping browser launch." + return + fi + + echo "Stopping any running Chromium instances..." + pkill -x chromium 2>/dev/null || true + pkill -x chromium-browser 2>/dev/null || true + pkill -x chrome 2>/dev/null || true + pkill -f 'google-chrome' 2>/dev/null || true + sleep 1 + + echo "Clearing Chromium cache..." + rm -rf "$HOME/.cache/chromium/Default/Cache"/* 2>/dev/null || true + rm -rf "$HOME/.cache/chromium/Default/Code Cache"/* 2>/dev/null || true + rm -rf "$HOME/.cache/google-chrome/Default/Cache"/* 2>/dev/null || true + rm -rf "$HOME/.cache/google-chrome/Default/Code Cache"/* 2>/dev/null || true + + echo "Launching $CHROMIUM_BIN at ${BASEURL}..." + setsid "$CHROMIUM_BIN" "${BASEURL}" >/dev/null 2>&1 < /dev/null & +} + case "${1:-run}" in stop) stop @@ -86,6 +116,8 @@ echo "Library rescan starting..." curl -fs -X POST "${BASEURL}/api/admin/rescan" -b "$COOKIE" > /dev/null 2>&1 || true echo "Rescan running in background (check tail -f $LOGFILE)" +launch_chromium + if [ "$BACKGROUND" != "true" ]; then tail -n +1 -f "$LOGFILE" & TAIL_PID=$! |
