2022-06-25 13:47:07 +08:00
|
|
|
import {
|
|
|
|
FetchArtistAlbumsResponse,
|
|
|
|
FetchArtistResponse,
|
|
|
|
FetchSimilarArtistsResponse,
|
|
|
|
} from './api/Artist'
|
2022-04-16 21:14:03 +08:00
|
|
|
import { FetchAlbumResponse } from './api/Album'
|
|
|
|
import {
|
2022-07-11 11:06:41 +08:00
|
|
|
FetchListenedRecordsResponse,
|
2022-04-16 21:14:03 +08:00
|
|
|
FetchUserAccountResponse,
|
|
|
|
FetchUserAlbumsResponse,
|
|
|
|
FetchUserArtistsResponse,
|
|
|
|
FetchUserLikedTracksIDsResponse,
|
|
|
|
FetchUserPlaylistsResponse,
|
|
|
|
} from './api/User'
|
2023-01-28 11:54:57 +08:00
|
|
|
import { FetchAudioSourceResponse, FetchLyricResponse, FetchTracksResponse } from './api/Track'
|
|
|
|
import { FetchPlaylistResponse, FetchRecommendedPlaylistsResponse } from './api/Playlists'
|
2023-03-03 03:12:27 +08:00
|
|
|
import { AppleMusicAlbum, AppleMusicArtist } from './AppleMusic'
|
2022-04-16 21:14:03 +08:00
|
|
|
|
2023-01-28 11:54:57 +08:00
|
|
|
export enum CacheAPIs {
|
2022-04-16 21:14:03 +08:00
|
|
|
Album = 'album',
|
|
|
|
Artist = 'artists',
|
|
|
|
ArtistAlbum = 'artist/album',
|
|
|
|
Likelist = 'likelist',
|
|
|
|
Lyric = 'lyric',
|
|
|
|
Personalized = 'personalized',
|
|
|
|
Playlist = 'playlist/detail',
|
|
|
|
RecommendResource = 'recommend/resource',
|
2023-01-28 11:54:57 +08:00
|
|
|
SongUrl = 'song/url/v1',
|
2022-04-16 21:14:03 +08:00
|
|
|
Track = 'song/detail',
|
|
|
|
UserAccount = 'user/account',
|
|
|
|
UserAlbums = 'album/sublist',
|
|
|
|
UserArtists = 'artist/sublist',
|
|
|
|
UserPlaylist = 'user/playlist',
|
2022-06-25 13:47:07 +08:00
|
|
|
SimilarArtist = 'simi/artist',
|
2022-07-11 11:06:41 +08:00
|
|
|
ListenedRecords = 'user/record',
|
2022-06-12 15:29:14 +08:00
|
|
|
|
|
|
|
// not netease api
|
|
|
|
CoverColor = 'cover_color',
|
2022-07-12 22:42:50 +08:00
|
|
|
AppleMusicAlbum = 'apple_music_album',
|
|
|
|
AppleMusicArtist = 'apple_music_artist',
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|
|
|
|
|
2023-01-28 11:54:57 +08:00
|
|
|
export interface CacheAPIsParams {
|
|
|
|
[CacheAPIs.Album]: { id: number }
|
|
|
|
[CacheAPIs.Artist]: { id: number }
|
|
|
|
[CacheAPIs.ArtistAlbum]: { id: number }
|
|
|
|
[CacheAPIs.Likelist]: void
|
|
|
|
[CacheAPIs.Lyric]: { id: number }
|
|
|
|
[CacheAPIs.Personalized]: void
|
|
|
|
[CacheAPIs.Playlist]: { id: number }
|
|
|
|
[CacheAPIs.RecommendResource]: void
|
|
|
|
[CacheAPIs.SongUrl]: { id: string }
|
|
|
|
[CacheAPIs.Track]: { ids: string }
|
|
|
|
[CacheAPIs.UserAccount]: void
|
|
|
|
[CacheAPIs.UserAlbums]: void
|
|
|
|
[CacheAPIs.UserArtists]: void
|
|
|
|
[CacheAPIs.UserPlaylist]: void
|
|
|
|
[CacheAPIs.SimilarArtist]: { id: number }
|
|
|
|
[CacheAPIs.ListenedRecords]: { id: number; type: number }
|
2022-07-12 22:42:50 +08:00
|
|
|
|
2023-01-28 11:54:57 +08:00
|
|
|
[CacheAPIs.CoverColor]: { id: number }
|
|
|
|
[CacheAPIs.AppleMusicAlbum]: { id: number }
|
|
|
|
[CacheAPIs.AppleMusicArtist]: { id: number }
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|
|
|
|
|
2023-01-28 11:54:57 +08:00
|
|
|
export interface CacheAPIsResponse {
|
|
|
|
[CacheAPIs.Album]: FetchAlbumResponse
|
|
|
|
[CacheAPIs.Artist]: FetchArtistResponse
|
|
|
|
[CacheAPIs.ArtistAlbum]: FetchArtistAlbumsResponse
|
|
|
|
[CacheAPIs.Likelist]: FetchUserLikedTracksIDsResponse
|
|
|
|
[CacheAPIs.Lyric]: FetchLyricResponse
|
|
|
|
[CacheAPIs.Personalized]: FetchRecommendedPlaylistsResponse
|
|
|
|
[CacheAPIs.Playlist]: FetchPlaylistResponse
|
|
|
|
[CacheAPIs.RecommendResource]: FetchRecommendedPlaylistsResponse
|
|
|
|
[CacheAPIs.SongUrl]: FetchAudioSourceResponse
|
|
|
|
[CacheAPIs.Track]: FetchTracksResponse
|
|
|
|
[CacheAPIs.UserAccount]: FetchUserAccountResponse
|
|
|
|
[CacheAPIs.UserAlbums]: FetchUserAlbumsResponse
|
|
|
|
[CacheAPIs.UserArtists]: FetchUserArtistsResponse
|
|
|
|
[CacheAPIs.UserPlaylist]: FetchUserPlaylistsResponse
|
|
|
|
[CacheAPIs.SimilarArtist]: FetchSimilarArtistsResponse
|
|
|
|
[CacheAPIs.ListenedRecords]: FetchListenedRecordsResponse
|
2022-07-12 22:42:50 +08:00
|
|
|
|
2023-01-28 11:54:57 +08:00
|
|
|
[CacheAPIs.CoverColor]: string | undefined
|
|
|
|
[CacheAPIs.AppleMusicAlbum]: AppleMusicAlbum | 'no'
|
|
|
|
[CacheAPIs.AppleMusicArtist]: AppleMusicArtist | 'no'
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|