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:
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
Reference in New Issue
Block a user