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
@@ -15,6 +15,7 @@ import {
import { NumberInput } from '/@/shared/components/number-input/number-input';
import { SegmentedControl } from '/@/shared/components/segmented-control/segmented-control';
import { Select } from '/@/shared/components/select/select';
import { Switch } from '/@/shared/components/switch/switch';
export const AutoDJSettings = memo(() => {
const { t } = useTranslation();
@@ -145,6 +146,40 @@ export const AutoDJSettings = memo(() => {
}),
title: t('setting.autoDJ_timing'),
},
{
control: (
<Switch
aria-label={t('setting.autoDJ_allowDuplicates')}
checked={settings.allowDuplicates}
onChange={(e) => {
setSettings({
autoDJ: {
allowDuplicates: e.currentTarget.checked,
},
});
}}
/>
),
description: t('setting.autoDJ_allowDuplicates_description'),
title: t('setting.autoDJ_allowDuplicates'),
},
{
control: (
<Switch
aria-label={t('setting.autoDJ_onlySimilar')}
checked={settings.onlySimilar}
onChange={(e) => {
setSettings({
autoDJ: {
onlySimilar: e.currentTarget.checked,
},
});
}}
/>
),
description: t('setting.autoDJ_onlySimilar_description'),
title: t('setting.autoDJ_onlySimilar'),
},
];
return <SettingsSection options={autoDJOptions} title={t('setting.autoDJ')} />;