mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
fix(mix): rating filter across mixes and Lucky Mix queue fill (#714)
* fix(mix): apply rating filter across mixes and fix Lucky Mix queue fill Invalidate entity rating cache on setRating and stop negative-caching unrated artists/albums so filters see fresh stars. Honor UI rating overrides, wire Instant Mix and CLI paths, fix Random Mix filter order, and align Lucky Mix progress with the real player queue length. * docs(changelog): document mix rating filter and Lucky Mix queue fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { join } from '@tauri-apps/api/path';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { getSimilarSongs2, getSimilarSongs, getTopSongs } from '../../api/subsonicArtists';
|
||||
import { filterSongsForLuckyMixRatings, getMixMinRatingsConfigFromAuth } from '../mix/mixRatingFilter';
|
||||
import { buildDownloadUrl } from '../../api/subsonicStreamUrl';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { usePlayerStore } from '../../store/playerStore';
|
||||
@@ -107,10 +108,13 @@ export async function startInstantMix(
|
||||
try {
|
||||
const similar = await getSimilarSongs(song.id, 50);
|
||||
if (serverId) useAuthStore.getState().setAudiomuseNavidromeIssue(serverId, false);
|
||||
const mixCfg = getMixMinRatingsConfigFromAuth();
|
||||
const ratedFiltered = await filterSongsForLuckyMixRatings(
|
||||
similar.filter(s => s.id !== song.id),
|
||||
mixCfg,
|
||||
);
|
||||
const shuffled = shuffleArray(
|
||||
similar
|
||||
.filter(s => s.id !== song.id)
|
||||
.map(s => ({ ...songToTrack(s), radioAdded: true as const })),
|
||||
ratedFiltered.map(s => ({ ...songToTrack(s), radioAdded: true as const })),
|
||||
);
|
||||
if (shuffled.length > 0) {
|
||||
const aid = song.artistId?.trim() || undefined;
|
||||
|
||||
Reference in New Issue
Block a user