diff --git a/src/routes/song/[id]/+page.server.ts b/src/routes/song/[id]/+page.server.ts
index 740ada8..27d2367 100644
--- a/src/routes/song/[id]/+page.server.ts
+++ b/src/routes/song/[id]/+page.server.ts
@@ -1,10 +1,9 @@
import type { PageServerLoad } from './$types'
-import { getLyricsProcessed, getSongMeta, listRecPlaylists, parseBrief } from "$lib/server/songs.ts";
+import { getLyricsProcessed, getSongRaw, listRecPlaylists } from "$lib/server/songs.ts";
export const load: PageServerLoad = async ({ params }) => {
const songId = +params.id
- const raw = await getSongMeta(songId)
- const brief = parseBrief(raw)
+ const song = await getSongRaw(songId)
const lrc = await getLyricsProcessed(songId)
- return { raw, brief, lrc }
+ return { song, lrc }
}
\ No newline at end of file
diff --git a/src/routes/song/[id]/+page.svelte b/src/routes/song/[id]/+page.svelte
index fc9fb62..0aaffdb 100644
--- a/src/routes/song/[id]/+page.svelte
+++ b/src/routes/song/[id]/+page.svelte
@@ -146,16 +146,16 @@
// Result is stored on the server and is fetched from a separate results page
async function submitResult() {
const res = await API.saveResult({
- songId: data.raw.id,
+ songId: data.song.id,
endTime: Date.now(),
- realTimeFactor: (Date.now() - startTime) / (data.raw.dt / 1000),
+ realTimeFactor: (Date.now() - startTime) / (data.song.dt / 1000),
totalTyped, totalRight, startTime, statsHistory
})
goto(`/results/${res.id}`)
}
-
+
diff --git a/src/shared/tools.ts b/src/shared/tools.ts
index 35957ad..5a499af 100644
--- a/src/shared/tools.ts
+++ b/src/shared/tools.ts
@@ -1,3 +1,3 @@
-import type { NeteaseSongBrief } from "./types";
+import type { NeteaseSong } from "./types";
-export const artistAndAlbum = (song: NeteaseSongBrief) => `${song.artists.map(it => it.name).join(', ')} - ${song.album}`
\ No newline at end of file
+export const artistAndAlbum = (song: NeteaseSong) => `${song.ar.map(it => it.name).join(', ')} - ${song.al.name}`
\ No newline at end of file
diff --git a/src/shared/types.ts b/src/shared/types.ts
index fa627fe..a0f85eb 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -10,13 +10,26 @@ export interface Song {
lyrics: LyricLine[]
}
-export interface NeteaseSongBrief {
+export interface NeteaseSong {
id: number
name: string
- album: string
- albumId: number
- albumPic: string
- artists: { id: number, name: string }[]
+ al: {
+ id: number
+ name: string
+ picUrl: string
+ }
+ ar: { id: number, name: string }[]
+ dt: number
+}
+
+export interface NeteasePlaylist {
+ id: number
+ name: string
+ coverImgUrl: string
+ creator: {
+ nickname: string
+ }
+ tracks: NeteaseSong[]
}
export interface ProcessedLyricLine {