How bbplayer-app/bbplayer works
BBPlayer is a local-first Bilibili audio player. The principal flow is user selection of a local or remote source, retrieval of tracks, playback through Orpheus, and optional caching for offline listening. Separate capabilities cover playlist import and synchronization, lyrics, themes, and account-backed library access. The repository also contains a playlist-sharing backend and a distinct update service with publishing tools. Edges are based on README-described capabilities and shown source references; unsampled implementation details are not inferred.
Main entry points: app App screens · trackService.ts Track services · server.go Update API · orpheus Player engine
Components 20
Mobile experience
- App screens
apps/mobile/src/app - Playlist services
apps/mobile/src/lib/services/playlistService.ts - Track services
apps/mobile/src/lib/services/trackService.ts - Local database
apps/mobile/src/lib/db/db.ts - Theme system
apps/mobile/src/lib/theme/SkinManager.ts
Playback and media
- Player engine
packages/orpheus - Download manager
apps/mobile/src/hooks/stores/useDownloadManagerStore.ts - Lyrics service
apps/mobile/src/lib/services/lyricService.ts - Playback history
apps/mobile/src/hooks/queries/playHistory.ts
Content integrations
- Bilibili APIs
apps/mobile/src/lib/api/bilibili/api.ts - Music services
apps/mobile/src/lib/api/netease/api.ts - Playlist sync
apps/mobile/src/lib/facades/syncBilibiliPlaylist/facade.ts
Sharing backend
- Sharing API
apps/backend/src/index.ts - Sharing database
apps/backend/src/db/schema.ts
Update platform
- Update API
apps/update-server/internal/server/server.go - Update store
apps/update-server/internal/store/store.go - Update publisher
apps/update-publisher/src/index.ts - Update CLI
apps/hot-update-cli/src/index.ts
Other components
- Listener
- Update client
Connections 19
- Listener → App screens: browses
- App screens → Playlist services: selects source
- Playlist services → Track services: loads tracks
- Track services → Local database: reads local data
- Track services → Bilibili APIs: retrieves media
- Track services → Music services: matches imports
- App screens → Player engine: controls playback
apps/mobile/src/app/settings/storage.tsx - Player engine → Download manager: reports progress
apps/mobile/src/hooks/stores/useDownloadManagerStore.ts - App screens → Lyrics service: requests lyrics
- Player engine → Playback history: records listening
- App screens → Playlist sync: starts synchronization
- Playlist sync → Bilibili APIs: syncs playlists
- App screens → Theme system: applies themes
- App screens → Sharing API: shares playlists
- Sharing API → Sharing database: persists data
- Update client → Update API: checks updates
- Update publisher → Update API: publishes releases
- Update CLI → Update API: manages releases
- Update API → Update store: reads and writes