🐛 fix no albums bug
This commit is contained in:
parent
be872ecf5b
commit
d60878c8ac
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ytmusic-api",
|
"name": "ytmusic-api",
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"description": "YouTube Music API",
|
"description": "YouTube Music API",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { ArtistBasic, ArtistDetailed, ArtistFull } from "../schemas"
|
import { ArtistBasic, ArtistDetailed, ArtistFull } from "../schemas"
|
||||||
import checkType from "../utils/checkType"
|
import checkType from "../utils/checkType"
|
||||||
|
import traverse from "../utils/traverse"
|
||||||
import traverseList from "../utils/traverseList"
|
import traverseList from "../utils/traverseList"
|
||||||
import traverseString from "../utils/traverseString"
|
import traverseString from "../utils/traverseString"
|
||||||
import AlbumParser from "./AlbumParser"
|
import AlbumParser from "./AlbumParser"
|
||||||
|
|
@ -23,11 +24,12 @@ export default class ArtistParser {
|
||||||
topSongs: traverseList(data, "musicShelfRenderer", "contents").map(item =>
|
topSongs: traverseList(data, "musicShelfRenderer", "contents").map(item =>
|
||||||
SongParser.parseArtistTopSong(item, artistBasic)
|
SongParser.parseArtistTopSong(item, artistBasic)
|
||||||
),
|
),
|
||||||
topAlbums: traverseList(data, "musicCarouselShelfRenderer")
|
topAlbums:
|
||||||
.at(0)
|
traverseList(data, "musicCarouselShelfRenderer")
|
||||||
.contents.map((item: any) =>
|
?.at(0)
|
||||||
|
?.contents.map((item: any) =>
|
||||||
AlbumParser.parseArtistTopAlbums(item, artistBasic)
|
AlbumParser.parseArtistTopAlbums(item, artistBasic)
|
||||||
)
|
) ?? []
|
||||||
},
|
},
|
||||||
ArtistFull
|
ArtistFull
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue