更新依赖

This commit is contained in:
lyswhut
2023-04-09 15:35:00 +08:00
parent 6d949d7e4d
commit bdd5b46708
18 changed files with 833 additions and 492 deletions
@@ -20,9 +20,9 @@ import {
* @param id 歌曲id
* @returns 歌词信息
*/
export const queryLyric = (id: string): LX.DBService.Lyricnfo[] => {
export const queryLyric = (id: string) => {
const lyricQueryStatement = createLyricQueryStatement()
return lyricQueryStatement.all(id)
return lyricQueryStatement.all(id) as LX.DBService.Lyricnfo[]
}
/**
@@ -30,9 +30,9 @@ export const queryLyric = (id: string): LX.DBService.Lyricnfo[] => {
* @param id 歌曲id
* @returns 歌词信息
*/
export const queryRawLyric = (id: string): LX.DBService.Lyricnfo[] => {
export const queryRawLyric = (id: string) => {
const rawLyricQueryStatement = createRawLyricQueryStatement()
return rawLyricQueryStatement.all(id)
return rawLyricQueryStatement.all(id) as LX.DBService.Lyricnfo[]
}
/**
@@ -84,7 +84,7 @@ export const clearRawLyric = () => {
*/
export const countRawLyric = () => {
const countStatement = createRawLyricCountStatement()
return countStatement.get().count
return (countStatement.get() as { count: number }).count
}
@@ -93,9 +93,9 @@ export const countRawLyric = () => {
* @param id 歌曲id
* @returns 歌词信息
*/
export const queryEditedLyric = (id: string): LX.DBService.Lyricnfo[] => {
export const queryEditedLyric = (id: string) => {
const rawLyricQueryStatement = createEditedLyricQueryStatement()
return rawLyricQueryStatement.all(id)
return rawLyricQueryStatement.all(id) as LX.DBService.Lyricnfo[]
}
/**
@@ -148,5 +148,5 @@ export const clearEditedLyric = () => {
*/
export const countEditedLyric = () => {
const countStatement = createEditedLyricCountStatement()
return countStatement.get().count
return (countStatement.get() as { count: number }).count
}
@@ -46,7 +46,7 @@ export const createRawLyricInsertStatement = () => {
*/
export const createRawLyricClearStatement = () => {
const db = getDB()
return db.prepare(`
return db.prepare<[]>(`
DELETE FROM "main"."lyric"
WHERE "source"='${RAW_LYRIC}'
`)
@@ -83,7 +83,7 @@ export const createRawLyricUpdateStatement = () => {
*/
export const createRawLyricCountStatement = () => {
const db = getDB()
return db.prepare(`SELECT COUNT(*) as count FROM "main"."lyric" WHERE "source"='${RAW_LYRIC}'`)
return db.prepare<[]>(`SELECT COUNT(*) as count FROM "main"."lyric" WHERE "source"='${RAW_LYRIC}'`)
}
@@ -117,7 +117,7 @@ export const createEditedLyricInsertStatement = () => {
*/
export const createEditedLyricClearStatement = () => {
const db = getDB()
return db.prepare(`
return db.prepare<[]>(`
DELETE FROM "main"."lyric"
WHERE "source"='${EDITED_LYRIC}'
`)
@@ -153,5 +153,5 @@ export const createEditedLyricUpdateStatement = () => {
*/
export const createEditedLyricCountStatement = () => {
const db = getDB()
return db.prepare(`SELECT COUNT(*) as count FROM "main"."lyric" WHERE "source"='${EDITED_LYRIC}'`)
return db.prepare<[]>(`SELECT COUNT(*) as count FROM "main"."lyric" WHERE "source"='${EDITED_LYRIC}'`)
}