Render unknown URLs inside the app shell and move ListeningStats to the domain types
Add catch-all routes so unknown pages 404 inside the (app) layout and unknown /api URLs return a JSON 404 instead of redirecting to the login page. Restore the full root error page.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { components } from '$lib/api/schema';
|
||||
import type { Album, LikedTrack, Mix, Paged, Playlist, Track } from '$lib/types';
|
||||
import type { Album, LikedTrack, ListeningStats, Mix, Paged, Playlist, Track } from '$lib/types';
|
||||
|
||||
type TrackDto = components['schemas']['TrackApplicationResponse'];
|
||||
type AlbumDto = components['schemas']['AlbumApplicationResponse'];
|
||||
@@ -84,12 +84,6 @@ export function toPlaylist(dto: PlaylistDto): Playlist {
|
||||
|
||||
type ListeningStatsDto = components['schemas']['ListeningStatsResponse'];
|
||||
|
||||
export interface ListeningStats {
|
||||
tracksThisWeek: number;
|
||||
secondsThisWeek: number;
|
||||
streakDays: number;
|
||||
}
|
||||
|
||||
export function toCount(value: number | string | null | undefined): number {
|
||||
return Number(value ?? 0) || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user