fix: 修正拼写错误 `inert*` 为 `insert*` (#2180)

pull/2189/head
14K 2024-12-17 19:49:19 +08:00 committed by GitHub
parent 527ac04c4e
commit 5d48fa93ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 26 additions and 26 deletions

View File

@ -20,7 +20,7 @@ export const queryDislikeList = () => {
* *
* @param infos * @param infos
*/ */
export const inertDislikeList = async(infos: LX.DBService.DislikeInfo[]) => { export const insertDislikeList = async(infos: LX.DBService.DislikeInfo[]) => {
const db = getDB() const db = getDB()
const insertStatement = createInsertStatement() const insertStatement = createInsertStatement()
db.transaction((infos: LX.DBService.DislikeInfo[]) => { db.transaction((infos: LX.DBService.DislikeInfo[]) => {

View File

@ -1,7 +1,7 @@
import { SPLIT_CHAR } from '@common/constants' import { SPLIT_CHAR } from '@common/constants'
import { import {
queryDislikeList, queryDislikeList,
inertDislikeList, insertDislikeList,
overwirteDislikeList, overwirteDislikeList,
// updateDislikeList, // updateDislikeList,
// deleteDislikeList, // deleteDislikeList,
@ -71,7 +71,7 @@ export const getDislikeListInfo = (): LX.Dislike.DislikeInfo => {
* @param lists * @param lists
*/ */
export const dislikeInfoAdd = async(lists: LX.Dislike.DislikeMusicInfo[]) => { export const dislikeInfoAdd = async(lists: LX.Dislike.DislikeMusicInfo[]) => {
await inertDislikeList(lists.map(info => ({ content: `${info.name}${SPLIT_CHAR.DISLIKE_NAME}${info.singer}` }))) await insertDislikeList(lists.map(info => ({ content: `${info.name}${SPLIT_CHAR.DISLIKE_NAME}${info.singer}` })))
} }
/** /**

View File

@ -20,7 +20,7 @@ export const queryDownloadList = () => {
* *
* @param mInfos * @param mInfos
*/ */
export const inertDownloadList = (mInfos: LX.DBService.DownloadMusicInfo[], listPositions: Array<{ id: string, position: number }>) => { export const insertDownloadList = (mInfos: LX.DBService.DownloadMusicInfo[], listPositions: Array<{ id: string, position: number }>) => {
const db = getDB() const db = getDB()
const insertStatement = createInsertStatement() const insertStatement = createInsertStatement()
const updatePositionStatement = createUpdatePositionStatement() const updatePositionStatement = createUpdatePositionStatement()

View File

@ -1,7 +1,7 @@
import { arrPush, arrUnshift } from '@common/utils/common' import { arrPush, arrUnshift } from '@common/utils/common'
import { import {
queryDownloadList, queryDownloadList,
inertDownloadList, insertDownloadList,
updateDownloadList, updateDownloadList,
deleteDownloadList, deleteDownloadList,
clearDownloadList, clearDownloadList,
@ -72,12 +72,12 @@ export const downloadInfoSave = (downloadInfos: LX.Download.ListItem[], addMusic
if (addMusicLocationType == 'top') { if (addMusicLocationType == 'top') {
let newList = [...list] let newList = [...list]
arrUnshift(newList, downloadInfos) arrUnshift(newList, downloadInfos)
inertDownloadList(toDBDownloadInfo(downloadInfos), newList.slice(downloadInfos.length - 1).map((info, index) => { insertDownloadList(toDBDownloadInfo(downloadInfos), newList.slice(downloadInfos.length - 1).map((info, index) => {
return { id: info.id, position: index } return { id: info.id, position: index }
})) }))
list = newList list = newList
} else { } else {
inertDownloadList(toDBDownloadInfo(downloadInfos, list.length), []) insertDownloadList(toDBDownloadInfo(downloadInfos, list.length), [])
arrPush(list, downloadInfos) arrPush(list, downloadInfos)
} }
} }

View File

@ -40,7 +40,7 @@ export const queryAllUserList = () => {
* @param lists * @param lists
* @param isClear * @param isClear
*/ */
export const inertUserLists = (lists: LX.DBService.UserListInfo[], isClear: boolean = false) => { export const insertUserLists = (lists: LX.DBService.UserListInfo[], isClear: boolean = false) => {
const db = getDB() const db = getDB()
const listClearStatement = createListClearStatement() const listClearStatement = createListClearStatement()
const listInsertStatement = createListInsertStatement() const listInsertStatement = createListInsertStatement()

View File

@ -2,7 +2,7 @@ import { LIST_IDS } from '@common/constants'
import { arrPush, arrPushByPosition, arrUnshift } from '@common/utils/common' import { arrPush, arrPushByPosition, arrUnshift } from '@common/utils/common'
import { import {
deleteUserLists, deleteUserLists,
inertUserLists, insertUserLists,
insertMusicInfoList, insertMusicInfoList,
insertMusicInfoListAndRefreshOrder, insertMusicInfoListAndRefreshOrder,
moveMusicInfo, moveMusicInfo,
@ -61,7 +61,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
position: position + index, position: position + index,
} }
}) })
inertUserLists(newLists) insertUserLists(newLists)
userLists = [...userLists, ...newLists] userLists = [...userLists, ...newLists]
} else { } else {
const newUserLists = [...userLists] const newUserLists = [...userLists]
@ -70,7 +70,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
newUserLists.forEach((list, index) => { newUserLists.forEach((list, index) => {
list.position = index list.position = index
}) })
inertUserLists(newUserLists, true) insertUserLists(newUserLists, true)
userLists = newUserLists userLists = newUserLists
} }
} }
@ -86,7 +86,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
// position: index, // position: index,
// } // }
// }) // })
// inertUserLists(newUserLists, true) // insertUserLists(newUserLists, true)
// userLists = newUserLists // userLists = newUserLists
// } // }
@ -145,7 +145,7 @@ export const updateUserListsPosition = (position: number, ids: string[]) => {
newUserLists.forEach((list, index) => { newUserLists.forEach((list, index) => {
list.position = index list.position = index
}) })
inertUserLists(newUserLists, true) insertUserLists(newUserLists, true)
userLists = newUserLists userLists = newUserLists
} }

View File

@ -39,7 +39,7 @@ export const queryRawLyric = (id: string) => {
* *
* @param lyrics * @param lyrics
*/ */
export const inertRawLyric = (lyrics: LX.DBService.Lyricnfo[]) => { export const insertRawLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
const db = getDB() const db = getDB()
const rawLyricInsertStatement = createRawLyricInsertStatement() const rawLyricInsertStatement = createRawLyricInsertStatement()
db.transaction((lyrics: LX.DBService.Lyricnfo[]) => { db.transaction((lyrics: LX.DBService.Lyricnfo[]) => {
@ -102,7 +102,7 @@ export const queryEditedLyric = (id: string) => {
* *
* @param lyrics * @param lyrics
*/ */
export const inertEditedLyric = (lyrics: LX.DBService.Lyricnfo[]) => { export const insertEditedLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
const db = getDB() const db = getDB()
const rawLyricInsertStatement = createEditedLyricInsertStatement() const rawLyricInsertStatement = createEditedLyricInsertStatement()
db.transaction((lyrics: LX.DBService.Lyricnfo[]) => { db.transaction((lyrics: LX.DBService.Lyricnfo[]) => {

View File

@ -1,12 +1,12 @@
import { import {
queryLyric, queryLyric,
queryRawLyric, queryRawLyric,
inertRawLyric, insertRawLyric,
deleteRawLyric, deleteRawLyric,
updateRawLyric, updateRawLyric,
clearRawLyric, clearRawLyric,
queryEditedLyric, queryEditedLyric,
inertEditedLyric, insertEditedLyric,
deleteEditedLyric, deleteEditedLyric,
updateEditedLyric, updateEditedLyric,
clearEditedLyric, clearEditedLyric,
@ -90,7 +90,7 @@ export const getRawLyric = (id: string): LX.Music.LyricInfo => {
* @param lyricInfo * @param lyricInfo
*/ */
export const rawLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => { export const rawLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => {
inertRawLyric(toDBLyric(id, 'raw', lyricInfo)) insertRawLyric(toDBLyric(id, 'raw', lyricInfo))
} }
/** /**
@ -150,7 +150,7 @@ export const getEditedLyric = (id: string): LX.Music.LyricInfo => {
* @param lyricInfo * @param lyricInfo
*/ */
export const editedLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => { export const editedLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => {
inertEditedLyric(toDBLyric(id, 'edited', lyricInfo)) insertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
} }
/** /**
@ -185,7 +185,7 @@ export const editedLyricClear = () => {
export const editedLyricUpdateAddAndUpdate = (id: string, lyricInfo: LX.Music.LyricInfo) => { export const editedLyricUpdateAddAndUpdate = (id: string, lyricInfo: LX.Music.LyricInfo) => {
const lyrics = queryEditedLyric(id) const lyrics = queryEditedLyric(id)
if (lyrics.length) updateEditedLyric(toDBLyric(id, 'edited', lyricInfo)) if (lyrics.length) updateEditedLyric(toDBLyric(id, 'edited', lyricInfo))
else inertEditedLyric(toDBLyric(id, 'edited', lyricInfo)) else insertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
} }
/** /**

View File

@ -22,7 +22,7 @@ export const queryMusicInfo = (id: string) => {
* *
* @param musicInfos * @param musicInfos
*/ */
export const inertMusicInfo = (musicInfos: LX.DBService.MusicInfoOtherSource[]) => { export const insertMusicInfo = (musicInfos: LX.DBService.MusicInfoOtherSource[]) => {
const db = getDB() const db = getDB()
const musicInfoInsertStatement = createMusicInfoInsertStatement() const musicInfoInsertStatement = createMusicInfoInsertStatement()
db.transaction((musicInfos: LX.DBService.MusicInfoOtherSource[]) => { db.transaction((musicInfos: LX.DBService.MusicInfoOtherSource[]) => {

View File

@ -1,6 +1,6 @@
import { import {
queryMusicInfo, queryMusicInfo,
inertMusicInfo, insertMusicInfo,
deleteMusicInfo, deleteMusicInfo,
clearMusicInfo, clearMusicInfo,
countMusicInfo, countMusicInfo,
@ -44,7 +44,7 @@ export const getMusicInfoOtherSource = (id: string): LX.Music.MusicInfoOnline[]
* @param musicInfos * @param musicInfos
*/ */
export const musicInfoOtherSourceAdd = (id: string, musicInfos: LX.Music.MusicInfoOnline[]) => { export const musicInfoOtherSourceAdd = (id: string, musicInfos: LX.Music.MusicInfoOnline[]) => {
inertMusicInfo(toDBMusicInfo(id, musicInfos)) insertMusicInfo(toDBMusicInfo(id, musicInfos))
} }
/** /**

View File

@ -22,7 +22,7 @@ export const queryMusicUrl = (id: string) => {
* url * url
* @param urlInfo * @param urlInfo
*/ */
export const inertMusicUrl = (urlInfo: LX.DBService.MusicUrlInfo[]) => { export const insertMusicUrl = (urlInfo: LX.DBService.MusicUrlInfo[]) => {
const db = getDB() const db = getDB()
const insertStatement = createInsertStatement() const insertStatement = createInsertStatement()
const deleteStatement = createDeleteStatement() const deleteStatement = createDeleteStatement()

View File

@ -1,6 +1,6 @@
import { import {
queryMusicUrl, queryMusicUrl,
inertMusicUrl, insertMusicUrl,
deleteMusicUrl, deleteMusicUrl,
clearMusicUrl, clearMusicUrl,
countMusicUrl, countMusicUrl,
@ -22,7 +22,7 @@ export const getMusicUrl = (id: string): string | null => {
* @param urlInfos url * @param urlInfos url
*/ */
export const musicUrlSave = (urlInfos: LX.Music.MusicUrlInfo[]) => { export const musicUrlSave = (urlInfos: LX.Music.MusicUrlInfo[]) => {
inertMusicUrl(urlInfos) insertMusicUrl(urlInfos)
} }
/** /**