Changed PlaylistDetailed to PlaylistFull
This commit is contained in:
parent
e87b3650f2
commit
9edefbb351
|
|
@ -206,11 +206,10 @@ export default class YTMusic {
|
||||||
* @param category Type of search results to receive
|
* @param category Type of search results to receive
|
||||||
*/
|
*/
|
||||||
public async search(query: string, category: "SONG"): Promise<YTMusic.SongDetailed[]>
|
public async search(query: string, category: "SONG"): Promise<YTMusic.SongDetailed[]>
|
||||||
public async search(query: string, category: "PLAYLIST"): Promise<YTMusic.PlaylistDetailed[]>
|
|
||||||
public async search(query: string, category: "VIDEO"): Promise<YTMusic.VideoDetailed[]>
|
public async search(query: string, category: "VIDEO"): Promise<YTMusic.VideoDetailed[]>
|
||||||
public async search(query: string, category: "ARTIST"): Promise<YTMusic.ArtistDetailed[]>
|
public async search(query: string, category: "ARTIST"): Promise<YTMusic.ArtistDetailed[]>
|
||||||
public async search(query: string, category: "ALBUM"): Promise<YTMusic.AlbumDetailed[]>
|
public async search(query: string, category: "ALBUM"): Promise<YTMusic.AlbumDetailed[]>
|
||||||
public async search(query: string, category: "PLAYLIST"): Promise<YTMusic.PlaylistDetailed[]>
|
public async search(query: string, category: "PLAYLIST"): Promise<YTMusic.PlaylistFull[]>
|
||||||
public async search(query: string): Promise<YTMusic.SearchResult[]>
|
public async search(query: string): Promise<YTMusic.SearchResult[]>
|
||||||
public async search(query: string, category?: string) {
|
public async search(query: string, category?: string) {
|
||||||
const searchData = await this.constructRequest("search", {
|
const searchData = await this.constructRequest("search", {
|
||||||
|
|
@ -335,7 +334,7 @@ export default class YTMusic {
|
||||||
* @param playlistId Playlist ID
|
* @param playlistId Playlist ID
|
||||||
* @returns Playlist Data
|
* @returns Playlist Data
|
||||||
*/
|
*/
|
||||||
public async getPlaylist(playlistId: string): Promise<YTMusic.PlaylistDetailed> {
|
public async getPlaylist(playlistId: string): Promise<YTMusic.PlaylistFull> {
|
||||||
if (playlistId.startsWith("PL")) playlistId = "VL" + playlistId
|
if (playlistId.startsWith("PL")) playlistId = "VL" + playlistId
|
||||||
const data = await this.constructRequest("browse", { browseId: playlistId })
|
const data = await this.constructRequest("browse", { browseId: playlistId })
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import traverse from "../utils/traverse"
|
import traverse from "../utils/traverse"
|
||||||
|
|
||||||
export default class PlaylistParser {
|
export default class PlaylistParser {
|
||||||
public static parse(data: any, playlistId: string): YTMusic.PlaylistDetailed {
|
public static parse(data: any, playlistId: string): YTMusic.PlaylistFull {
|
||||||
return {
|
return {
|
||||||
type: "PLAYLIST",
|
type: "PLAYLIST",
|
||||||
playlistId,
|
playlistId,
|
||||||
|
|
@ -19,7 +19,7 @@ export default class PlaylistParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static parseSearchResult(item: any): YTMusic.PlaylistDetailed {
|
public static parseSearchResult(item: any): YTMusic.PlaylistFull {
|
||||||
const flexColumns = traverse(item, "flexColumns")
|
const flexColumns = traverse(item, "flexColumns")
|
||||||
const artistId = traverse(flexColumns[1], "browseId")
|
const artistId = traverse(flexColumns[1], "browseId")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ declare namespace YTMusic {
|
||||||
songs: SongDetailed[]
|
songs: SongDetailed[]
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PlaylistDetailed {
|
interface PlaylistFull {
|
||||||
type: "PLAYLIST"
|
type: "PLAYLIST"
|
||||||
playlistId: string
|
playlistId: string
|
||||||
name: string
|
name: string
|
||||||
|
|
@ -86,9 +86,8 @@ declare namespace YTMusic {
|
||||||
|
|
||||||
type SearchResult =
|
type SearchResult =
|
||||||
| SongDetailed
|
| SongDetailed
|
||||||
| PlaylistDetailed
|
|
||||||
| VideoDetailed
|
| VideoDetailed
|
||||||
| AlbumDetailed
|
| AlbumDetailed
|
||||||
| ArtistDetailed
|
| ArtistDetailed
|
||||||
| PlaylistDetailed
|
| PlaylistFull
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue