add album mode for autodj

- add selection modes: similar, random
- add autodj settings in playerbar popover
This commit is contained in:
jeffvli
2026-05-12 02:12:38 -07:00
parent f3b72504f1
commit 239ef4a4ec
13 changed files with 906 additions and 172 deletions
@@ -0,0 +1,28 @@
import type { Genre } from '/@/shared/types/domain-types';
import { ServerType } from '/@/shared/types/domain-types';
export const autoDjPushUniqueAlbumIds = (
accumulator: string[],
seenAlbums: Set<string>,
queueAlbumIdSet: Set<string>,
...ids: (string | undefined)[]
) => {
for (const id of ids) {
if (!id || queueAlbumIdSet.has(id) || seenAlbums.has(id)) continue;
seenAlbums.add(id);
accumulator.push(id);
}
};
export const autoDjGenreIdsForSongGenre = (genre: Genre, serverType: ServerType): string[] => {
if (serverType === ServerType.JELLYFIN) {
return [genre.id];
}
if (serverType === ServerType.NAVIDROME || serverType === ServerType.SUBSONIC) {
return [genre.name];
}
return [genre.id];
};