Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wait for Typesense before HTTP calls

Ensure the Typesense subprocess is accepting connections before any
collection/indexing HTTP calls. Remove the redundant wait and replace a
panic-inducing unwrap with a warning log to avoid crashing on failures

+6 -5
+6 -5
crates/cli/src/lib.rs
··· 150 150 rt.block_on(async { 151 151 rockbox_typesense::setup()?; 152 152 153 + // Wait for Typesense to accept connections before any HTTP calls. 154 + // The subprocess thread starts typesense-server concurrently, so it 155 + // may not be listening yet when we reach the first collection call. 156 + wait_for_typesense().await; 157 + 153 158 let pool = create_connection_pool().await?; 154 159 let tracks = repo::track::all(pool.clone()).await?; 155 160 if tracks.is_empty() || update_library { ··· 170 175 insert_albums(albums.into_iter().map(Album::from).collect()).await?; 171 176 } 172 177 173 - // Always sync playlists on startup so the collection exists even when the 174 - // library scan was skipped. Wait for Typesense to be ready first since it 175 - // may still be starting when tracks are already indexed (no scan delay). 176 - wait_for_typesense().await; 177 178 create_playlists_collection().await?; 178 179 let playlist_store = PlaylistStore::new(pool.clone()); 179 180 let saved = playlist_store.list().await.unwrap_or_default(); ··· 205 206 } 206 207 Ok::<(), Error>(()) 207 208 }) 208 - .unwrap(); 209 + .unwrap_or_else(|e| warn!("Library indexing failed: {}", e)); 209 210 210 211 thread::spawn(move || { 211 212 sleep(Duration::from_secs(5));