Release v1.3.0: Multi-source downloads, audio analyzer resilience, mobile improvements
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
This commit is contained in:
@@ -5,13 +5,15 @@
|
||||
*/
|
||||
export function formatTime(seconds: number): string {
|
||||
if (isNaN(seconds) || !isFinite(seconds) || seconds < 0) return "0:00";
|
||||
|
||||
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const mins = Math.floor((seconds % 3600) / 60);
|
||||
const secs = Math.floor(seconds % 60);
|
||||
|
||||
|
||||
if (hours > 0) {
|
||||
return `${hours}:${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
||||
return `${hours}:${mins.toString().padStart(2, "0")}:${secs
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
}
|
||||
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
||||
}
|
||||
@@ -22,10 +24,10 @@ export function formatTime(seconds: number): string {
|
||||
*/
|
||||
export function formatDuration(seconds: number): string {
|
||||
if (isNaN(seconds) || !isFinite(seconds) || seconds < 0) return "0m";
|
||||
|
||||
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const mins = Math.floor((seconds % 3600) / 60);
|
||||
|
||||
|
||||
if (hours > 0) {
|
||||
if (mins > 0) {
|
||||
return `${hours}h ${mins}m`;
|
||||
@@ -35,21 +37,31 @@ export function formatDuration(seconds: number): string {
|
||||
return `${mins}m`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamp a time value to be within valid bounds
|
||||
* Ensures currentTime never exceeds duration
|
||||
*/
|
||||
export function clampTime(currentTime: number, duration: number): number {
|
||||
if (duration <= 0) return Math.max(0, currentTime);
|
||||
return Math.min(Math.max(0, currentTime), duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format remaining time with negative prefix
|
||||
* For durations under 1 hour: -m:ss (e.g., -5:32)
|
||||
* For durations 1 hour or more: -h:mm:ss (e.g., -1:05:32)
|
||||
*/
|
||||
export function formatTimeRemaining(seconds: number): string {
|
||||
if (isNaN(seconds) || !isFinite(seconds) || seconds <= 0) return "0:00";
|
||||
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const mins = Math.floor((seconds % 3600) / 60);
|
||||
const secs = Math.floor(seconds % 60);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (hours > 0) {
|
||||
return `-${hours}:${mins.toString().padStart(2, "0")}:${secs
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
}
|
||||
return `-${mins}:${secs.toString().padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user