forked from Furumi/furumi-web
4d6a1513d9f8f0f726bab0c09d17ac14dd5e1b7b
Each source playlist gets an ordinary private playlist, created with its
PlaylistCreated operation in one transaction even when nothing matched.
Matched entries follow in source order, at most 200 per transaction: the
playlist row, the item register, the existing PlaylistTrackAdded operation
and a receipt are written together, so fed_sync_ops serves as the outbox
and an interrupted batch leaves nothing behind. Locks are taken in a fixed
order (per-user advisory lock, import lease, playlist, fed-device identity,
registers). Registers are only inserted; an item the playlist has or had,
a removal committed to the journal but not yet applied, a repeat or a
receipt keep the publisher from adding it again. A deleted target pauses
publication until POST .../playlists/{pid}/recreate; POST .../resync
retries unmatched entries and appends new matches at the end.
Before each batch the outgoing Device Sync line is measured by serializing
the same parts the exchange sends. Tracks and new playlists are published
while the music snapshot stays within library_import_sync_budget (2 MiB)
and the whole line within 7 MiB; the rest waits as deferred_sync_limit.
Device Sync gets local helpers only: create_owned_playlist_tx is extracted
from the playlist handler, append_in_transaction takes an explicit
position, the two operations have in-transaction variants on
append_local_op, and applying a playlist item writes its register under an
atomic last-writer-wins condition and its playlist row in the same
transaction, so concurrent operations cannot make them diverge. The
protocol and its formats are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Furumusic
Your library. Your users. Your network.
Furumusic is a self-hosted music server with a full web player. Bring your music, share a library with friends, and keep your own playlists, likes, and listening history. Listen from a desktop or phone, or connect independent servers through the Furumi federated network.
What you can do
- Listen anywhere. Browse artists and releases, search your collection, build queues, and manage playlists in a responsive web player.
- Bring your collection. Upload files and folders, or import music from YouTube, torrents, and magnet links directly into your library or a playlist.
- Organize your music. Optional AI assistance recognizes metadata, finds artwork, and helps repair messy releases. Review proposed changes before applying them.
- Share a song. Send a track or queue link that anyone can play and download without creating an account.
- Welcome your people. Use password login or SSO. Instance admins can approve new users without needing access to the identity provider.
- Discover more. Find similar tracks and connect Last.fm for scrobbling.
- Read along. View synchronized or plain lyrics, choose a text version, and enrich your collection with LRCLIB or edit texts manually. See lyrics.
- Connect your players. Pair trusted Furumi devices to synchronize playlists, likes, playback state, and playback controls.
- Join a network. Discover and stream music from other participating peers while keeping your own library independent.
- Manage from any screen. Review imports, manage users and background tasks, and explore listening statistics in a desktop and mobile admin console.
AI assistance, federation, similarity search, Last.fm, and SSO are optional. You choose which features to enable.
Quick start
With Rust and PostgreSQL installed, create an empty database and start the server:
export FURU_DATABASE_URL='postgresql://furumusic:password@127.0.0.1/furumusic'
cargo run --release --locked
Open http://127.0.0.1:8000/admin/setup to create your administrator account, then configure the inbox and music library directories in Admin → Settings.
Documentation
- Installation and configuration
- Using and administering Furumusic
- Development, architecture, and tests
- Admin UI conventions
Bug reports, ideas, and contributions are welcome.
Languages
Rust
65.8%
HTML
31.8%
JavaScript
2.3%