autodj fixes and enhancements (#2271)

- add setting to allow duplicates
- add setting to only prefer similar sogs
- fix autodj algorithm to match by the priority order instead of incorrectly grouping when limit not reached
This commit is contained in:
jeffvli
2026-07-23 19:51:30 -07:00
parent e0ac1c0db6
commit a0bae0ffb0
12 changed files with 406 additions and 127 deletions
@@ -461,9 +461,11 @@ const ENV_SETTING_SPECS: EnvSettingSpec[] = [
path: ['autoDJ', 'albumStrategy'],
type: 'enum',
},
{ key: 'FS_AUTO_DJ_ALLOW_DUPLICATES', path: ['autoDJ', 'allowDuplicates'], type: 'bool' },
{ key: 'FS_AUTO_DJ_ENABLED', path: ['autoDJ', 'enabled'], type: 'bool' },
{ key: 'FS_AUTO_DJ_ITEM_COUNT', path: ['autoDJ', 'itemCount'], type: 'num' },
{ enumSet: AUTO_DJ_MODES, key: 'FS_AUTO_DJ_MODE', path: ['autoDJ', 'mode'], type: 'enum' },
{ key: 'FS_AUTO_DJ_ONLY_SIMILAR', path: ['autoDJ', 'onlySimilar'], type: 'bool' },
{
enumSet: AUTO_DJ_STRATEGIES,
key: 'FS_AUTO_DJ_SONG_STRATEGY',
+4
View File
@@ -746,9 +746,11 @@ const autoDjStrategyEnum = z.enum(['similar', 'library_random']);
const AutoDJSettingsSchema = z.object({
albumStrategy: autoDjStrategyEnum,
allowDuplicates: z.boolean(),
enabled: z.boolean(),
itemCount: z.number(),
mode: z.enum(['songs', 'albums']),
onlySimilar: z.boolean(),
songStrategy: autoDjStrategyEnum,
timing: z.number(),
});
@@ -1219,9 +1221,11 @@ const platformDefaultWindowBarStyle: Platform = getPlatformDefaultWindowBarStyle
const initialState: SettingsState = {
autoDJ: {
albumStrategy: AUTO_DJ_STRATEGY.SIMILAR,
allowDuplicates: false,
enabled: false,
itemCount: 5,
mode: 'songs',
onlySimilar: false,
songStrategy: AUTO_DJ_STRATEGY.SIMILAR,
timing: 1,
},