From e4a84fbb2c10dd69d82c5b06dcc88d1a2f354f24 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 15 Nov 2025 22:29:07 +0800 Subject: [PATCH] Update songs.ts --- src/shared/songs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/songs.ts b/src/shared/songs.ts index 4ab3ac0..696d1c7 100644 --- a/src/shared/songs.ts +++ b/src/shared/songs.ts @@ -25,7 +25,7 @@ const cached = (filePath: (arg: T) => Promise, fn: (arg: T) => Pro } const result = await fn(arg) await fs.mkdir(path.dirname(file), { recursive: true }) - await fs.writeFile(file, JSON.stringify(result, null, 2), 'utf-8') + await fs.writeFile(file, JSON.stringify(result), 'utf-8') return result } @@ -51,7 +51,7 @@ const getPlaylistRaw = cached( for (const track of pl.playlist.tracks) { const p = path.join('data', 'songs', `${track.id}`, 'meta.json') await fs.mkdir(path.dirname(p), { recursive: true }) - await fs.writeFile(p, JSON.stringify(track, null, 2), 'utf-8') + await fs.writeFile(p, JSON.stringify(track), 'utf-8') } return pl } @@ -98,4 +98,4 @@ export const getLyricsProcessed = cached( ) // console.log((await getSongsFromPlaylist('580208139')).length) -console.log(await getLyricsProcessed(25723366, true)) \ No newline at end of file +console.log(await getLyricsProcessed(25723366)) \ No newline at end of file