Skip to content

Fix relative library paths and candidate preview crash#312

Closed
btc08gh wants to merge 2 commits into
pSpitzner:mainfrom
btc08gh:main
Closed

Fix relative library paths and candidate preview crash#312
btc08gh wants to merge 2 commits into
pSpitzner:mainfrom
btc08gh:main

Conversation

@btc08gh
Copy link
Copy Markdown

@btc08gh btc08gh commented May 24, 2026

Summary

This PR contains two related fixes discovered while deploying and testing beets-flask in a real-world Docker/Unraid environment.

  1. Resolve relative Beets library paths

Fix handling of relative Beets library paths so the frontend/API correctly resolves library and asset references when Beets is configured with non-absolute paths.

This resolves issues encountered in containerized deployments where relative paths caused inconsistent behavior during inbox/import operations.

  1. Prevent frontend crashes when artwork retrieval fails

Fix frontend crash during candidate/cover-art preview when artwork retrieval fails.

While testing candidate selection on iPad Safari/WebKit, we discovered the issue was not the import backend itself but frontend error handling in coverArt.tsx.

The app assumed artwork fetch failures would always surface as HTTPError. In reality, browsers can also throw generic fetch/runtime exceptions such as:

TypeError: Load failed

These non-HTTP errors were re-thrown into the React route error boundary, causing the entire candidate/details UI to crash instead of displaying the intended missing-cover placeholder.

Result

Before:

  • relative Beets library paths could resolve incorrectly
  • missing/broken artwork could crash the entire candidate UI

After:

  • relative library paths resolve correctly
  • failed artwork fetches display the existing placeholder image
  • candidate review/import remains functional even when Cover Art Archive artwork is unavailable

Tested

  • Docker deployment on Unraid
  • iPad Safari/WebKit
  • Desktop Chrome
  • Direct LAN access (no reverse proxy)
  • Candidate browsing with missing Cover Art Archive artwork
  • Import Best flow

@github-actions
Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@pSpitzner
Copy link
Copy Markdown
Owner

Hey hey,

thanks for the PR 😃

Could you help us understand the issue a bit better, please?

Beets flask (stable) is currently still based on beets 2.5.1 and we are still updating to later versions (e.g. PR #310)

Afaik, relative paths in the beets library were only introduced in beets 2.10 so I am a bit confused, what you based your PR on. Did beets already store cover paths in relative format before then?

Best,
p

@btc08gh
Copy link
Copy Markdown
Author

btc08gh commented May 24, 2026

To be honest I’m pretty new to beets and all. I just checked and you are correct!
the beets container I use that created my DB is a newer version and likely why things were broken for me. I grabbed beets from the Unraid CA store before I happened upon beets-flask and figured I could simply reuse my DB without any issues.

root@fed699cfff70:/config# beet --version
beets version 2.11.0
Python version 3.12.13
plugins: chroma, convert, embedart, fetchart, lastgenre, musicbrainz, replaygain, scrub, web
root@fed699cfff70:/config#

Sounds like I’ve fixed something prior to it being a problem for the masses and already being worked on.

At any rate it all works great now (even if it’s just a me thing!)

The iPad error handling is still legit and fixed but I will close this PR as self-inflicted.

thanks for the app BTW. It’s very cool!

@btc08gh
Copy link
Copy Markdown
Author

btc08gh commented May 24, 2026

Closing as this is already being worked on in #310

@btc08gh btc08gh closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants