.PHONY: up down clean browser-clean setup

up:
	python run_server.py

down:
	pkill -f "uvicorn src.server.fastapi_app:app" || pkill -f "python.*run_server.py" || true

clean:
	rm -rf data/*.db data/*.db-shm data/*.db-wal data/config.json

browser-clean:
	rm -rf "$$HOME/.cache/microsoft-edge"/* || true
	rm -rf "$$HOME/.cache/mozilla/firefox"/* || true
	find "$$HOME/.mozilla/firefox" -name "cache2" -type d -exec rm -rf {} \; 2>/dev/null || true

setup:
	curl -X POST http://127.0.0.1:8000/setup \
		-H "Content-Type: application/json" \
		-H "X-API-Key: 299ae8f630a31bda814263c551361448" \
		-d '{"path": "/home/lukas/Volume/serien/", "password": "Hallo123!"}'