mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
refactor(api): F.48 — extract subsonic types + client primitives (#613)
First Phase F slice. Splits the 1333-LOC `api/subsonic.ts` along its two most obvious axes: - `subsonicTypes.ts` — all ~24 exported interfaces + type aliases (album/song/artist/playlist/directory/genre/now-playing/radio, random-songs filters, three statistics shapes, search + starred results, AlbumInfo, structured-lyrics types, etc.) plus the `RADIO_PAGE_SIZE` constant. - `subsonicClient.ts` — token-auth + `getClient` + `api<T>()` + `libraryFilterParams` + `secureRandomSalt` / `getAuthParams` / `SUBSONIC_CLIENT`. The credential-bearing API helpers (`pingWithCredentials`, `apiWithCredentials`, `restBaseFromUrl`, `probeInstantMixWithCredentials`) stay in `subsonic.ts` for now — they could move into the client module in a follow-up. 66 external call sites migrated to direct imports from the new modules (no re-export shims in `subsonic.ts`). Pure code-move; contract test stays green. subsonic.ts: 1333 → 1078 LOC (−255).
This commit is contained in:
committed by
GitHub
parent
acdb0ae795
commit
72030f17fd
@@ -1,4 +1,4 @@
|
||||
import type { EntityRatingSupportLevel } from '../api/subsonic';
|
||||
import type { EntityRatingSupportLevel } from '../api/subsonicTypes';
|
||||
import type {
|
||||
InstantMixProbeResult,
|
||||
SubsonicServerIdentity,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { SubsonicSong } from '../api/subsonicTypes';
|
||||
import { create } from 'zustand';
|
||||
import { persist, createJSONStorage } from 'zustand/middleware';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { buildStreamUrl, getArtist, getAlbum } from '../api/subsonic';
|
||||
import type { SubsonicSong } from '../api/subsonic';
|
||||
import { useAuthStore } from './authStore';
|
||||
import { showToast } from '../utils/toast';
|
||||
import { useOfflineJobStore, cancelledDownloads } from './offlineJobStore';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { InternetRadioStation } from '../api/subsonic';
|
||||
import type { InternetRadioStation } from '../api/subsonicTypes';
|
||||
import type { PlaybackSourceKind } from '../utils/resolvePlaybackUrl';
|
||||
|
||||
export interface Track {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { SubsonicPlaylist } from '../api/subsonicTypes';
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { getPlaylists, createPlaylist as apiCreatePlaylist, SubsonicPlaylist } from '../api/subsonic';
|
||||
|
||||
import { getPlaylists, createPlaylist as apiCreatePlaylist } from '../api/subsonic';
|
||||
interface PlaylistStore {
|
||||
recentIds: string[];
|
||||
playlists: SubsonicPlaylist[];
|
||||
|
||||
Reference in New Issue
Block a user