Major Features: - Multi-source download system (Soulseek/Lidarr with fallback) - Configurable enrichment speed control (1-5x) - Mobile touch drag support for seek sliders - iOS PWA media controls (Control Center, Lock Screen) - Artist name alias resolution via Last.fm - Circuit breaker pattern for audio analysis Critical Fixes: - Audio analyzer stability (non-ASCII, BrokenProcessPool, OOM) - Discovery system race conditions and import failures - Radio decade categorization using originalYear - LastFM API response normalization - Mood bucket infinite loop prevention Security: - Bull Board admin authentication - Lidarr webhook signature verification - JWT token expiration and refresh - Encryption key validation on startup Closes #2, #6, #9, #13, #21, #26, #31, #34, #35, #37, #40, #43
17 lines
460 B
TypeScript
17 lines
460 B
TypeScript
/**
|
|
* Format large numbers into compact notation (e.g., 5,100,000 → "5.1M")
|
|
*/
|
|
export function formatListeners(count: number | undefined): string {
|
|
if (!count || count === 0) return "Artist";
|
|
|
|
if (count >= 1000000) {
|
|
return `${(count / 1000000).toFixed(1)}M listeners`;
|
|
}
|
|
|
|
if (count >= 1000) {
|
|
return `${(count / 1000).toFixed(count >= 10000 ? 0 : 1)}K listeners`;
|
|
}
|
|
|
|
return `${count.toLocaleString()} listeners`;
|
|
}
|