mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
feat(settings): library card grid max columns in Appearance (4–12, default 6)
Persist libraryGridMaxColumns, wire useCardGridMetrics and card grid layout, add i18n and settings search index; document performance hint in copy.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { clampStoredLoudnessPreAnalysisAttenuationRefDb } from '../utils/audio/loudnessPreAnalysisSlider';
|
||||
import {
|
||||
DEFAULT_LOUDNESS_PRE_ANALYSIS_ATTENUATION_DB,
|
||||
DEFAULT_LIBRARY_GRID_MAX_COLUMNS,
|
||||
LIBRARY_GRID_MAX_COLUMNS_MAX,
|
||||
LIBRARY_GRID_MAX_COLUMNS_MIN,
|
||||
LOUDNESS_LUFS_PRESETS,
|
||||
MIX_MIN_RATING_FILTER_MAX_STARS,
|
||||
RANDOM_MIX_SIZE_OPTIONS,
|
||||
@@ -41,6 +44,13 @@ export function clampRandomMixSize(v: number): number {
|
||||
return nearest;
|
||||
}
|
||||
|
||||
/** Persisted max columns for library card grids (albums, artists, playlists, …). */
|
||||
export function clampLibraryGridMaxColumns(v: unknown): number {
|
||||
const n = typeof v === 'number' ? v : Number(v);
|
||||
if (!Number.isFinite(n)) return DEFAULT_LIBRARY_GRID_MAX_COLUMNS;
|
||||
return Math.max(LIBRARY_GRID_MAX_COLUMNS_MIN, Math.min(LIBRARY_GRID_MAX_COLUMNS_MAX, Math.round(n)));
|
||||
}
|
||||
|
||||
export function clampSkipStarThreshold(v: number): number {
|
||||
if (!Number.isFinite(v)) return 3;
|
||||
return Math.max(1, Math.min(99, Math.round(v)));
|
||||
|
||||
Reference in New Issue
Block a user