feat: updates

This commit is contained in:
qier222 2022-10-28 20:29:04 +08:00
parent a1b0bcf4d3
commit 884f3df41a
No known key found for this signature in database
198 changed files with 4572 additions and 5336 deletions

View file

@ -9,7 +9,7 @@ export const enum IpcChannels {
Close = 'Close',
IsMaximized = 'IsMaximized',
FullscreenStateChange = 'FullscreenStateChange',
GetApiCacheSync = 'GetApiCacheSync',
GetApiCache = 'GetApiCache',
DevDbExportJson = 'DevDbExportJson',
CacheCoverColor = 'CacheCoverColor',
SetTrayTooltip = 'SetTrayTooltip',
@ -26,6 +26,7 @@ export const enum IpcChannels {
ResetWindowSize = 'ResetWindowSize',
GetAlbumFromAppleMusic = 'GetAlbumFromAppleMusic',
GetArtistFromAppleMusic = 'GetArtistFromAppleMusic',
Logout = 'Logout',
}
// ipcMain.on params
@ -36,7 +37,7 @@ export interface IpcChannelsParams {
[IpcChannels.Close]: void
[IpcChannels.IsMaximized]: void
[IpcChannels.FullscreenStateChange]: void
[IpcChannels.GetApiCacheSync]: {
[IpcChannels.GetApiCache]: {
api: APIs
query?: any
}
@ -68,6 +69,7 @@ export interface IpcChannelsParams {
artist: string
}
[IpcChannels.GetArtistFromAppleMusic]: { id: number; name: string }
[IpcChannels.Logout]: void
}
// ipcRenderer.on params
@ -78,7 +80,7 @@ export interface IpcChannelsReturns {
[IpcChannels.Close]: void
[IpcChannels.IsMaximized]: boolean
[IpcChannels.FullscreenStateChange]: boolean
[IpcChannels.GetApiCacheSync]: any
[IpcChannels.GetApiCache]: any
[IpcChannels.DevDbExportJson]: void
[IpcChannels.CacheCoverColor]: void
[IpcChannels.SetTrayTooltip]: void
@ -92,4 +94,5 @@ export interface IpcChannelsReturns {
[IpcChannels.GetAudioCacheSize]: void
[IpcChannels.GetAlbumFromAppleMusic]: AppleMusicAlbum | undefined
[IpcChannels.GetArtistFromAppleMusic]: AppleMusicArtist | undefined
[IpcChannels.Logout]: void
}

View file

@ -0,0 +1,15 @@
export const enum AppleMusicTables {
Album = 'Album',
Artist = 'Artist',
}
export interface AppleMusicTablesStructures {
[AppleMusicTables.Album]: {
id: string
json: string
}
[AppleMusicTables.Artist]: {
id: string
json: string
}
}

View file

@ -0,0 +1,44 @@
export const enum NeteaseTables {
AccountData = 'AccountData',
Album = 'Album',
Artist = 'Artist',
ArtistAlbum = 'ArtistAlbum',
Audio = 'Audio',
Lyric = 'Lyric',
Playlist = 'Playlist',
Track = 'Track',
}
interface CommonTableStructure {
id: number
json: string
updatedAt: number
}
export interface NeteaseTablesStructures {
[NeteaseTables.AccountData]: {
id: string
json: string
updatedAt: number
}
[NeteaseTables.Album]: CommonTableStructure
[NeteaseTables.Artist]: CommonTableStructure
[NeteaseTables.ArtistAlbum]: CommonTableStructure
[NeteaseTables.Audio]: {
id: number
br: number
type: 'mp3' | 'flac' | 'ogg' | 'wav' | 'm4a' | 'aac' | 'unknown' | 'opus'
source:
| 'unknown'
| 'netease'
| 'migu'
| 'kuwo'
| 'kugou'
| 'youtube'
| 'qq'
| 'bilibili'
| 'joox'
queriedAt: number
}
[NeteaseTables.Lyric]: CommonTableStructure
[NeteaseTables.Playlist]: CommonTableStructure
[NeteaseTables.Track]: CommonTableStructure
}

View file

@ -0,0 +1,20 @@
export const enum ReplayTables {
CoverColor = 'CoverColor',
AppData = 'AppData',
}
export interface ReplayTableKeys {
[ReplayTables.CoverColor]: number
[ReplayTables.AppData]: 'appVersion' | 'skippedVersion'
}
export interface ReplayTableStructures {
[ReplayTables.CoverColor]: {
id: number
color: string
queriedAt: number
}
[ReplayTables.AppData]: {
value: string
}
}