refactor: Prototype of tanstack-query (#34)

* move getApiUrl to api folder

* adjust imports

* tanstack-query example with homeData

* small adjustments

* fix key collision

* new MusicSource persistent mechanism example

* add error handling & set sveltekit to SPA mode

* remove unnecessary ssr test
This commit is contained in:
Arno
2026-04-11 14:46:07 +02:00
committed by GitHub
parent e74ff3b3c4
commit 63ccf03dac
36 changed files with 769 additions and 521 deletions
+2 -2
View File
@@ -7,14 +7,14 @@ export type MusicSource = 'listenbrainz' | 'lastfm';
export type MusicSourcePage = keyof typeof PAGE_SOURCE_KEYS;
const CACHED_SOURCE_KEY = 'musicseerr_primary_source';
const DEFAULT_SOURCE: MusicSource = 'listenbrainz';
export const DEFAULT_SOURCE: MusicSource = 'listenbrainz';
interface MusicSourceState {
source: MusicSource;
loaded: boolean;
}
function isMusicSource(value: unknown): value is MusicSource {
export function isMusicSource(value: unknown): value is MusicSource {
return value === 'listenbrainz' || value === 'lastfm';
}
-1
View File
@@ -823,7 +823,6 @@ describe('beforeunload beacon', () => {
let addEventListenerSpy: ReturnType<typeof vi.fn>;
let removeEventListenerSpy: ReturnType<typeof vi.fn>;
let sendBeaconMock: ReturnType<typeof vi.fn>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let jellyfinApi: {
startSession: ReturnType<typeof vi.fn>;
reportProgress: ReturnType<typeof vi.fn>;
+1 -1
View File
@@ -1,7 +1,7 @@
import { browser } from '$app/environment';
import { api } from '$lib/api/client';
import { libraryStore } from '$lib/stores/library';
import { getApiUrl } from '$lib/utils/api';
import { getApiUrl } from '$lib/api/api-utils';
export type SyncStatus = {
is_syncing: boolean;