refactor(api): co-locate server-protocol clients into lib/api

Move the Subsonic + Navidrome protocol clients and the library IPC facade
(subsonic*, navidrome*, library.ts + tests) from src/api/ into src/lib/api/,
the feature-free infra layer (plan M4, decision §10.3: shared client core → lib/).
Pure move: deep-path import specifiers @/api/* -> @/lib/api/* across ~150
consumers; no behaviour change. Domain REST (lyrics/events) and cover/analysis
infra stay in src/api/ pending their own M4 placement.

tsc 0, lint 0/0, full suite 319 files / 2353 tests green.
This commit is contained in:
Psychotoxical
2026-06-30 07:53:25 +02:00
parent 429e632598
commit 7e9cb60763
392 changed files with 652 additions and 652 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import type { SubsonicSong } from '../api/subsonicTypes';
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
import { CoverArtImage, type CoverArtImageProps } from './CoverArtImage';
import { useTrackCoverRef } from './useLibraryCoverRef';
import { COVER_SCOPE_ACTIVE, type CoverServerScope } from './types';
+1 -1
View File
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState, type CSSProperties, type ImgHTMLAttributes } from 'react';
import type { SubsonicArtistInfo } from '../api/subsonicTypes';
import type { SubsonicArtistInfo } from '@/lib/api/subsonicTypes';
import { isRealArtistImage } from '../utils/componentHelpers/nowPlayingHelpers';
import { CoverArtImage } from './CoverArtImage';
import type { CoverArtRef, CoverSurfaceKind } from './types';
+1 -1
View File
@@ -1,7 +1,7 @@
import {
buildCoverArtUrl,
buildCoverArtUrlForServer,
} from '../api/subsonicStreamUrl';
} from '@/lib/api/subsonicStreamUrl';
import { getPlaybackServerId } from '../utils/playback/playbackServer';
import { useAuthStore } from '../store/authStore';
import { connectBaseUrlForServer } from '../utils/server/serverEndpoint';
+1 -1
View File
@@ -1,4 +1,4 @@
import { buildCoverArtUrlForServer } from '../../api/subsonicStreamUrl';
import { buildCoverArtUrlForServer } from '@/lib/api/subsonicStreamUrl';
import { serverShareBaseUrl } from '../../utils/server/serverEndpoint';
import { useAuthStore } from '../../store/authStore';
import type { CoverArtRef } from '../types';
+1 -1
View File
@@ -1,7 +1,7 @@
import { getPlaybackServerId } from '../utils/playback/playbackServer';
import { useAuthStore } from '../store/authStore';
import { coverServerScopeForServerId } from './serverScope';
import type { SubsonicSong } from '../api/subsonicTypes';
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
import type { CoverArtId, CoverArtRef, CoverCacheKind, CoverServerScope } from './types';
import {
albumHasDistinctDiscCovers,
+1 -1
View File
@@ -8,7 +8,7 @@
* stay in sync with `resolve_album_cover` / `resolve_artist_cover` there.
*/
import type { SubsonicAlbum, SubsonicSong } from '../api/subsonicTypes';
import type { SubsonicAlbum, SubsonicSong } from '@/lib/api/subsonicTypes';
import type { CoverArtRef, CoverCacheKind, CoverServerScope } from './types';
/** Resolved cover identity — maps 1:1 to Rust `CoverEntry`. */
+1 -1
View File
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import type { SubsonicSong } from '../api/subsonicTypes';
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
import { coverPrefetchRegister } from './prefetchRegistry';
import {
resolveAlbumCoverRefsFromLibrary,
+1 -1
View File
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState, type Dispatch, type SetStateAction } from 'react';
import type { SubsonicSong } from '../api/subsonicTypes';
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
import { useAuthStore } from '../store/authStore';
import { usePlayerStore } from '../store/playerStore';
import {
+1 -1
View File
@@ -1,5 +1,5 @@
import { coverCachePeekBatch } from '../api/coverCache';
import type { SubsonicAlbum } from '../api/subsonicTypes';
import type { SubsonicAlbum } from '@/lib/api/subsonicTypes';
import { coverEnsureQueued, ensureArtistBackdropQueued } from './ensureQueue';
import { getDiskSrcForGrid, rememberGridDiskSrc } from './diskSrcLookup';
import { albumCoverRef, artistCoverRef } from './ref';