mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
feat: updates
This commit is contained in:
parent
222fb02355
commit
47e41dea9b
24 changed files with 380 additions and 130 deletions
30
packages/shared/AppleMusic.ts
Normal file
30
packages/shared/AppleMusic.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
export interface AppleMusicAlbum {
|
||||
attributes: {
|
||||
name: string
|
||||
artistName: string
|
||||
editorialVideo: {
|
||||
motionSquareVideo1x1: {
|
||||
video: string
|
||||
}
|
||||
}
|
||||
editorialNotes: {
|
||||
short: string
|
||||
standard: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface AppleMusicArtist {
|
||||
attributes: {
|
||||
name: string
|
||||
artistBio: string
|
||||
editorialVideo: {
|
||||
motionArtistSquare1x1: {
|
||||
video: string
|
||||
}
|
||||
}
|
||||
artwork: {
|
||||
url: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ import {
|
|||
FetchPlaylistResponse,
|
||||
FetchRecommendedPlaylistsResponse,
|
||||
} from './api/Playlists'
|
||||
import { AppleMusicAlbum, AppleMusicArtist } from 'AppleMusic'
|
||||
|
||||
export const enum APIs {
|
||||
Album = 'album',
|
||||
|
|
@ -41,8 +42,10 @@ export const enum APIs {
|
|||
ListenedRecords = 'user/record',
|
||||
|
||||
// not netease api
|
||||
Artists = 'artistsNotNetease',
|
||||
CoverColor = 'cover_color',
|
||||
VideoCover = 'video_cover',
|
||||
AppleMusicAlbum = 'apple_music_album',
|
||||
AppleMusicArtist = 'apple_music_artist',
|
||||
}
|
||||
|
||||
export interface APIsParams {
|
||||
|
|
@ -61,9 +64,12 @@ export interface APIsParams {
|
|||
[APIs.UserArtists]: void
|
||||
[APIs.UserPlaylist]: void
|
||||
[APIs.SimilarArtist]: { id: number }
|
||||
[APIs.CoverColor]: { id: number }
|
||||
[APIs.VideoCover]: { id: number }
|
||||
[APIs.ListenedRecords]: { id: number; type: number }
|
||||
|
||||
[APIs.Artists]: { ids: number[] }
|
||||
[APIs.CoverColor]: { id: number }
|
||||
[APIs.AppleMusicAlbum]: { id: number }
|
||||
[APIs.AppleMusicArtist]: { id: number }
|
||||
}
|
||||
|
||||
export interface APIsResponse {
|
||||
|
|
@ -82,7 +88,10 @@ export interface APIsResponse {
|
|||
[APIs.UserArtists]: FetchUserArtistsResponse
|
||||
[APIs.UserPlaylist]: FetchUserPlaylistsResponse
|
||||
[APIs.SimilarArtist]: FetchSimilarArtistsResponse
|
||||
[APIs.CoverColor]: string | undefined
|
||||
[APIs.VideoCover]: string | undefined
|
||||
[APIs.ListenedRecords]: FetchListenedRecordsResponse
|
||||
|
||||
[APIs.Artists]: FetchArtistResponse[]
|
||||
[APIs.CoverColor]: string | undefined
|
||||
[APIs.AppleMusicAlbum]: AppleMusicAlbum | 'no'
|
||||
[APIs.AppleMusicArtist]: AppleMusicArtist | 'no'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { AppleMusicAlbum, AppleMusicArtist } from './AppleMusic'
|
||||
import { APIs } from './CacheAPIs'
|
||||
import { RepeatMode } from './playerDataTypes'
|
||||
|
||||
|
|
@ -22,8 +23,8 @@ export const enum IpcChannels {
|
|||
SyncSettings = 'SyncSettings',
|
||||
GetAudioCacheSize = 'GetAudioCacheSize',
|
||||
ResetWindowSize = 'ResetWindowSize',
|
||||
GetVideoCover = 'GetVideoCover',
|
||||
SetVideoCover = 'SetVideoCover',
|
||||
GetAlbumFromAppleMusic = 'GetAlbumFromAppleMusic',
|
||||
GetArtistFromAppleMusic = 'GetArtistFromAppleMusic',
|
||||
}
|
||||
|
||||
// ipcMain.on params
|
||||
|
|
@ -59,8 +60,12 @@ export interface IpcChannelsParams {
|
|||
[IpcChannels.SyncSettings]: any
|
||||
[IpcChannels.GetAudioCacheSize]: void
|
||||
[IpcChannels.ResetWindowSize]: void
|
||||
[IpcChannels.GetVideoCover]: { id: number; name: string; artist: string }
|
||||
[IpcChannels.SetVideoCover]: { id: number; url: string }
|
||||
[IpcChannels.GetAlbumFromAppleMusic]: {
|
||||
id: number
|
||||
name: string
|
||||
artist: string
|
||||
}
|
||||
[IpcChannels.GetArtistFromAppleMusic]: { id: number; name: string }
|
||||
}
|
||||
|
||||
// ipcRenderer.on params
|
||||
|
|
@ -82,6 +87,6 @@ export interface IpcChannelsReturns {
|
|||
[IpcChannels.Like]: void
|
||||
[IpcChannels.Repeat]: RepeatMode
|
||||
[IpcChannels.GetAudioCacheSize]: void
|
||||
[IpcChannels.GetVideoCover]: string | undefined
|
||||
[IpcChannels.SetVideoCover]: void
|
||||
[IpcChannels.GetAlbumFromAppleMusic]: AppleMusicAlbum | undefined
|
||||
[IpcChannels.GetArtistFromAppleMusic]: AppleMusicArtist | undefined
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue