Something went wrong. Try again.
An AI-music permissible frontend for plyr.fm.
Something went wrong. Try again.
1234567891011121314151617181920212223/** * Pure utility functions shared across screens and components. * No React, no side effects — just data transformation. */
/** AI tool tags used by the Discover screen to highlight AI-generated music tools */export const AI_TOOL_TAGS = ['suno', 'udio', 'stable audio', 'musicgen', 'riffusion'] as const;
/** Check if a tag name corresponds to a known AI music tool */export function isAiTool(name: string): boolean { const lower = name.toLowerCase(); return AI_TOOL_TAGS.some(t => lower.includes(t));}
/** * Format a duration in seconds to "m:ss" format. * Returns empty string for undefined/null. Returns "0:00" for 0. */export function formatDuration(seconds?: number | null): string { if (seconds == null) return ''; return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}`;}