Files
navidrome/ui/src/consts.js
T
Tom Boucher c42570446b fix(ui): allow DefaultTheme "Auto" from config (#5190)
* fix(ui): allow DefaultTheme "Auto" from config

When DefaultTheme is set to "Auto" in the server config, the
defaultTheme() function in themeReducer now returns AUTO_THEME_ID
instead of falling through to the DarkTheme fallback.

This allows useCurrentTheme to correctly read prefers-color-scheme
and select Light or Dark theme automatically for new/incognito users.

Adds themeReducer unit tests covering Auto, named-theme, and
unrecognized-value fallback paths.

* chore: format

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
Co-authored-by: Deluan <deluan@navidrome.org>
2026-03-15 14:00:21 -04:00

32 lines
674 B
JavaScript

export const REST_URL = '/api'
export const INSIGHTS_DOC_URL =
'https://navidrome.org/docs/getting-started/insights'
export const M3U_MIME_TYPE = 'audio/x-mpegurl'
export const AUTO_THEME_ID = 'AUTO_THEME_ID'
export const AUTO_THEME_CONFIG_VALUE = 'Auto'
export const DraggableTypes = {
SONG: 'song',
ALBUM: 'album',
DISC: 'disc',
ARTIST: 'artist',
ALL: [],
}
DraggableTypes.ALL.push(
DraggableTypes.SONG,
DraggableTypes.ALBUM,
DraggableTypes.DISC,
DraggableTypes.ARTIST,
)
export const DEFAULT_SHARE_BITRATE = 128
export const BITRATE_CHOICES = [
32, 48, 64, 80, 96, 112, 128, 160, 192, 256, 320,
].map((b) => ({ id: b, name: b.toString() }))