Skip to content

Commit

Permalink
Fixed vite frontend startup
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Jan 29, 2025
1 parent 2cb3e84 commit 44920a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lyrics_transcriber/review/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
def start_vite_server():
"""Get path to the built frontend assets."""
global vite_process # We'll keep this for backwards compatibility

# Get the path to the built frontend assets
current_dir = os.path.dirname(os.path.abspath(__file__))
frontend_dir = os.path.abspath(os.path.join(current_dir, "../frontend/dist"))

if not os.path.exists(frontend_dir):
raise FileNotFoundError(f"Frontend assets not found at {frontend_dir}. Ensure the package was built correctly.")

# Mount the static files
app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend")

logger.info(f"Mounted frontend assets from {frontend_dir}")
return None # No process to return since we're serving static files

Expand Down Expand Up @@ -115,10 +115,10 @@ def start_review_server(correction_result: CorrectionResult) -> CorrectionResult
server_thread.start()
logger.info("Server thread started")

# Open browser
# Open browser - Updated to use port 8000 instead of 5173
base_api_url = "http://localhost:8000/api"
encoded_api_url = urllib.parse.quote(base_api_url, safe="")
webbrowser.open(f"http://localhost:5173?baseApiUrl={encoded_api_url}")
webbrowser.open(f"http://localhost:8000?baseApiUrl={encoded_api_url}")
logger.info("Opened browser for review")

# Wait for review to complete
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lyrics-transcriber"
version = "0.34.2"
version = "0.34.3"
description = "Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify"
authors = ["Andrew Beveridge <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 44920a7

Please sign in to comment.