Overview
BeatSaver is the primary repository for custom Beat Saber maps. ScoreSaber Reloaded integrates with BeatSaver to enrich leaderboard and score data with map metadata, song information, and mapper details.What is BeatSaver?
BeatSaver provides:- Custom map hosting and distribution
- Map metadata (song name, artist, mapper)
- Difficulty information for each characteristic
- Song cover art
- Mapper profiles and statistics
- Map version history
- Download statistics
How SSR Integrates
API Service
SSR implements a rate-limited BeatSaver API service:common/src/api-service/impl/beatsaver.ts:12-20
API Endpoints
The service uses BeatSaver’s public API:common/src/api-service/impl/beatsaver.ts:8-10
Data Synchronized
Map Metadata
For each map, SSR fetches and caches:- Basic Info: Map name, BSR key, hash
- Song Details: Song name, artist, BPM, duration
- Mapper Info: Mapper name, avatar, ID
- Description: Full map description
- Song Art: Cover image URL
- Versions: All versions with different difficulties
backend/src/service/beatsaver.service.ts:39-58
Difficulty Information
SSR extracts specific difficulty data for each map characteristic:backend/src/service/beatsaver.service.ts:59-68
Map Lookup
Single Map Lookup
Lookup a single map by its hash:common/src/api-service/impl/beatsaver.ts:28-40
Batch Lookup
Lookup multiple maps at once (up to 50):common/src/api-service/impl/beatsaver.ts:48-66
Latest Maps
Fetch the latest maps with filtering options:common/src/api-service/impl/beatsaver.ts:76-109
Database Storage
Maps are stored in MongoDB for long-term caching:backend/src/service/beatsaver.service.ts:104-118
API Controller
SSR exposes a BeatSaver proxy endpoint:backend/src/controller/beatsaver.controller.ts:11-35
Endpoint:
hash(string): Map hashdifficulty(MapDifficulty): Difficulty levelcharacteristic(MapCharacteristic): Map characteristic (Standard, OneSaber, etc.)type(query): Detail level - “basic” or “full”
Caching Strategy
Two-Tier Caching
SSR implements a two-tier caching system:- Redis Cache: Short-term cache for API responses
- MongoDB Storage: Long-term storage for map data
backend/src/service/beatsaver.service.ts:79-96
Cache Key
Maps are cached using Redis with the following key format:backend/src/service/beatsaver.service.ts:31-33
Discord Logging
BeatSaver-related events are logged to a dedicated Discord channel:backend/src/bot/bot.ts:32
Hash Normalization
All map hashes are normalized to lowercase before storage and lookup to ensure consistency.
backend/src/service/beatsaver.service.ts:105-107
Rate Limiting
BeatSaver has a rate limit of 10 requests per second. SSR’s service automatically handles this:common/src/api-service/impl/beatsaver.ts:14-18
Use Cases
Enriching Leaderboards
When displaying leaderboards, SSR fetches BeatSaver data to show:- Song name and artist
- Map cover art
- Mapper name
- Map description
Playlist Generation
BeatSaver data is used when generating playlists to include:- Correct song metadata
- Cover images
- Difficulty labels
Search Functionality
BeatSaver integration enables search by:- Song name
- Mapper name
- BSR key