diff --git a/src/features/artist/utils/runArtistDetailActions.ts b/src/features/artist/utils/runArtistDetailActions.ts index e3a87d5f..219cfb6a 100644 --- a/src/features/artist/utils/runArtistDetailActions.ts +++ b/src/features/artist/utils/runArtistDetailActions.ts @@ -1,6 +1,6 @@ import type React from 'react'; import type { TFunction } from 'i18next'; -import { uploadArtistImage } from '@/lib/api/subsonicPlaylists'; +import { uploadArtistImage } from '@/lib/api/subsonicArtists'; import { setRating, star, unstar } from '@/lib/api/subsonicStarRating'; import type { SubsonicArtist } from '@/lib/api/subsonicTypes'; import { useAuthStore } from '@/store/authStore'; diff --git a/src/features/randomMix/index.ts b/src/features/randomMix/index.ts index 4276d2d8..0adb5811 100644 --- a/src/features/randomMix/index.ts +++ b/src/features/randomMix/index.ts @@ -5,9 +5,9 @@ * random-mix queue-build helpers. The pages are lazy-loaded by the router via * their deep paths, so they are not re-exported here. * - * Stays OUT (shared infra, consumed by the playback core too, not owned): - * `utils/mix/mixRatingFilter` (a generic rating-window filter used by the - * infinite-queue builder + home/album/CLI → a `lib/` candidate). + * Stays OUT (owned by the playback feature, consumed cross-feature here): + * `features/playback/utils/mixRatingFilter` (rating-window filter driven by the + * infinite-queue builder; reads playback's userRatingOverrides). */ export { useLuckyMixAvailable, isLuckyMixAvailable } from './hooks/useLuckyMixAvailable'; export { useLuckyMixStore } from './store/luckyMixStore'; diff --git a/src/lib/api/subsonicArtists.ts b/src/lib/api/subsonicArtists.ts index 6db84df9..1fa2ceac 100644 --- a/src/lib/api/subsonicArtists.ts +++ b/src/lib/api/subsonicArtists.ts @@ -1,3 +1,4 @@ +import { invoke } from '@tauri-apps/api/core'; import { useAuthStore } from '@/store/authStore'; import { api, apiForServer, libraryFilterParams, libraryFilterParamsForServer } from '@/lib/api/subsonicClient'; import { filterSongsToServerLibrary } from '@/lib/api/subsonicLibrary'; @@ -157,3 +158,20 @@ export async function fetchSimilarTracksRouted(songId: string, count = 50): Prom } return []; } + +export async function uploadArtistImage(id: string, file: File): Promise { + // Navidrome-specific endpoint — handled in Rust to bypass browser CORS restrictions. + const { getBaseUrl, getActiveServer } = useAuthStore.getState(); + const server = getActiveServer(); + const baseUrl = getBaseUrl(); + const buffer = await file.arrayBuffer(); + const fileBytes = Array.from(new Uint8Array(buffer)); + await invoke('upload_artist_image', { + serverUrl: baseUrl, + artistId: id, + username: server?.username ?? '', + password: server?.password ?? '', + fileBytes, + mimeType: file.type || 'image/jpeg', + }); +} diff --git a/src/lib/api/subsonicPlaylists.ts b/src/lib/api/subsonicPlaylists.ts index ca860591..aa1eb5a8 100644 --- a/src/lib/api/subsonicPlaylists.ts +++ b/src/lib/api/subsonicPlaylists.ts @@ -88,23 +88,6 @@ export async function uploadPlaylistCoverArt(id: string, file: File): Promise { - // Navidrome-specific endpoint — handled in Rust to bypass browser CORS restrictions. - const { getBaseUrl, getActiveServer } = useAuthStore.getState(); - const server = getActiveServer(); - const baseUrl = getBaseUrl(); - const buffer = await file.arrayBuffer(); - const fileBytes = Array.from(new Uint8Array(buffer)); - await invoke('upload_artist_image', { - serverUrl: baseUrl, - artistId: id, - username: server?.username ?? '', - password: server?.password ?? '', - fileBytes, - mimeType: file.type || 'image/jpeg', - }); -} - export async function deletePlaylist(id: string): Promise { await api('deletePlaylist.view', { id }); }