Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修正拼写错误 inert*insert* #2180

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/worker/dbService/modules/dislike_list/dbHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const queryDislikeList = () => {
* 批量插入不喜欢歌曲并刷新顺序
* @param infos 列表
*/
export const inertDislikeList = async(infos: LX.DBService.DislikeInfo[]) => {
export const insertDislikeList = async(infos: LX.DBService.DislikeInfo[]) => {
const db = getDB()
const insertStatement = createInsertStatement()
db.transaction((infos: LX.DBService.DislikeInfo[]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/main/worker/dbService/modules/dislike_list/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SPLIT_CHAR } from '@common/constants'
import {
queryDislikeList,
inertDislikeList,
insertDislikeList,
overwirteDislikeList,
// updateDislikeList,
// deleteDislikeList,
Expand Down Expand Up @@ -71,7 +71,7 @@ export const getDislikeListInfo = (): LX.Dislike.DislikeInfo => {
* @param lists 列表信息
*/
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}` })))
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/worker/dbService/modules/download/dbHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const queryDownloadList = () => {
* 批量插入下载歌曲并刷新顺序
* @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 insertStatement = createInsertStatement()
const updatePositionStatement = createUpdatePositionStatement()
Expand Down
6 changes: 3 additions & 3 deletions src/main/worker/dbService/modules/download/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { arrPush, arrUnshift } from '@common/utils/common'
import {
queryDownloadList,
inertDownloadList,
insertDownloadList,
updateDownloadList,
deleteDownloadList,
clearDownloadList,
Expand Down Expand Up @@ -72,12 +72,12 @@ export const downloadInfoSave = (downloadInfos: LX.Download.ListItem[], addMusic
if (addMusicLocationType == 'top') {
let newList = [...list]
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 }
}))
list = newList
} else {
inertDownloadList(toDBDownloadInfo(downloadInfos, list.length), [])
insertDownloadList(toDBDownloadInfo(downloadInfos, list.length), [])
arrPush(list, downloadInfos)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/worker/dbService/modules/list/dbHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const queryAllUserList = () => {
* @param lists 列表
* @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 listClearStatement = createListClearStatement()
const listInsertStatement = createListInsertStatement()
Expand Down
10 changes: 5 additions & 5 deletions src/main/worker/dbService/modules/list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LIST_IDS } from '@common/constants'
import { arrPush, arrPushByPosition, arrUnshift } from '@common/utils/common'
import {
deleteUserLists,
inertUserLists,
insertUserLists,
insertMusicInfoList,
insertMusicInfoListAndRefreshOrder,
moveMusicInfo,
Expand Down Expand Up @@ -61,7 +61,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
position: position + index,
}
})
inertUserLists(newLists)
insertUserLists(newLists)
userLists = [...userLists, ...newLists]
} else {
const newUserLists = [...userLists]
Expand All @@ -70,7 +70,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
newUserLists.forEach((list, index) => {
list.position = index
})
inertUserLists(newUserLists, true)
insertUserLists(newUserLists, true)
userLists = newUserLists
}
}
Expand All @@ -86,7 +86,7 @@ export const createUserLists = (position: number, lists: LX.List.UserListInfo[])
// position: index,
// }
// })
// inertUserLists(newUserLists, true)
// insertUserLists(newUserLists, true)
// userLists = newUserLists
// }

Expand Down Expand Up @@ -145,7 +145,7 @@ export const updateUserListsPosition = (position: number, ids: string[]) => {
newUserLists.forEach((list, index) => {
list.position = index
})
inertUserLists(newUserLists, true)
insertUserLists(newUserLists, true)
userLists = newUserLists
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/worker/dbService/modules/lyric/dbHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const queryRawLyric = (id: string) => {
* 批量插入原始歌词
* @param lyrics 列表
*/
export const inertRawLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
export const insertRawLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
const db = getDB()
const rawLyricInsertStatement = createRawLyricInsertStatement()
db.transaction((lyrics: LX.DBService.Lyricnfo[]) => {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const queryEditedLyric = (id: string) => {
* 批量插入已编辑歌词
* @param lyrics 列表
*/
export const inertEditedLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
export const insertEditedLyric = (lyrics: LX.DBService.Lyricnfo[]) => {
const db = getDB()
const rawLyricInsertStatement = createEditedLyricInsertStatement()
db.transaction((lyrics: LX.DBService.Lyricnfo[]) => {
Expand Down
10 changes: 5 additions & 5 deletions src/main/worker/dbService/modules/lyric/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
queryLyric,
queryRawLyric,
inertRawLyric,
insertRawLyric,
deleteRawLyric,
updateRawLyric,
clearRawLyric,
queryEditedLyric,
inertEditedLyric,
insertEditedLyric,
deleteEditedLyric,
updateEditedLyric,
clearEditedLyric,
Expand Down Expand Up @@ -90,7 +90,7 @@ export const getRawLyric = (id: string): LX.Music.LyricInfo => {
* @param lyricInfo 歌词信息
*/
export const rawLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => {
inertRawLyric(toDBLyric(id, 'raw', lyricInfo))
insertRawLyric(toDBLyric(id, 'raw', lyricInfo))
}

/**
Expand Down Expand Up @@ -150,7 +150,7 @@ export const getEditedLyric = (id: string): LX.Music.LyricInfo => {
* @param lyricInfo 歌词信息
*/
export const editedLyricAdd = (id: string, lyricInfo: LX.Music.LyricInfo) => {
inertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
insertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
}

/**
Expand Down Expand Up @@ -185,7 +185,7 @@ export const editedLyricClear = () => {
export const editedLyricUpdateAddAndUpdate = (id: string, lyricInfo: LX.Music.LyricInfo) => {
const lyrics = queryEditedLyric(id)
if (lyrics.length) updateEditedLyric(toDBLyric(id, 'edited', lyricInfo))
else inertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
else insertEditedLyric(toDBLyric(id, 'edited', lyricInfo))
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const queryMusicInfo = (id: string) => {
* 批量插入歌曲信息
* @param musicInfos 列表
*/
export const inertMusicInfo = (musicInfos: LX.DBService.MusicInfoOtherSource[]) => {
export const insertMusicInfo = (musicInfos: LX.DBService.MusicInfoOtherSource[]) => {
const db = getDB()
const musicInfoInsertStatement = createMusicInfoInsertStatement()
db.transaction((musicInfos: LX.DBService.MusicInfoOtherSource[]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/main/worker/dbService/modules/music_other_source/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
queryMusicInfo,
inertMusicInfo,
insertMusicInfo,
deleteMusicInfo,
clearMusicInfo,
countMusicInfo,
Expand Down Expand Up @@ -44,7 +44,7 @@ export const getMusicInfoOtherSource = (id: string): LX.Music.MusicInfoOnline[]
* @param musicInfos 歌词信息
*/
export const musicInfoOtherSourceAdd = (id: string, musicInfos: LX.Music.MusicInfoOnline[]) => {
inertMusicInfo(toDBMusicInfo(id, musicInfos))
insertMusicInfo(toDBMusicInfo(id, musicInfos))
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/worker/dbService/modules/music_url/dbHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const queryMusicUrl = (id: string) => {
* 批量插入歌曲url
* @param urlInfo 列表
*/
export const inertMusicUrl = (urlInfo: LX.DBService.MusicUrlInfo[]) => {
export const insertMusicUrl = (urlInfo: LX.DBService.MusicUrlInfo[]) => {
const db = getDB()
const insertStatement = createInsertStatement()
const deleteStatement = createDeleteStatement()
Expand Down
4 changes: 2 additions & 2 deletions src/main/worker/dbService/modules/music_url/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
queryMusicUrl,
inertMusicUrl,
insertMusicUrl,
deleteMusicUrl,
clearMusicUrl,
countMusicUrl,
Expand All @@ -22,7 +22,7 @@ export const getMusicUrl = (id: string): string | null => {
* @param urlInfos url信息
*/
export const musicUrlSave = (urlInfos: LX.Music.MusicUrlInfo[]) => {
inertMusicUrl(urlInfos)
insertMusicUrl(urlInfos)
}

/**
Expand Down
Loading