auto follow queue when autodj is triggered

This commit is contained in:
jeffvli
2025-12-28 14:34:38 -08:00
parent 0a54f7c44c
commit ffdef596ad
3 changed files with 39 additions and 0 deletions
@@ -2,6 +2,7 @@ import { useQueryClient } from '@tanstack/react-query';
import { useEffect } from 'react';
import { queryKeys } from '/@/renderer/api/query-keys';
import { eventEmitter } from '/@/renderer/events/event-emitter';
import { useIsPlayerFetching, usePlayer } from '/@/renderer/features/player/context/player-context';
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
import {
@@ -198,6 +199,11 @@ export const useAutoDJ = () => {
// Add to the end of the queue
player.addToQueueByData(songsToAdd, Play.LAST);
// Emit event to trigger queue follow
eventEmitter.emit('AUTODJ_QUEUE_ADDED', {
songCount: songsToAdd.length,
});
} catch (error) {
logFn.error(logMsg[LogCategory.PLAYER].autoPlayFailed, {
category: LogCategory.PLAYER,