🔥 remove subscriber count from artist full
This commit is contained in:
parent
c912078967
commit
5c93e58da4
|
|
@ -9,7 +9,6 @@
|
||||||
| name | `string` | Name |
|
| name | `string` | Name |
|
||||||
| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails |
|
| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails |
|
||||||
| description | `string` | Description |
|
| description | `string` | Description |
|
||||||
| subscribers | `number` | Number of subscribers the Artist has |
|
|
||||||
| topSongs | `Omit<`[SongDetailed](./SongDetailed.html)`, "duration">[]` | Top Songs from Artist |
|
| topSongs | `Omit<`[SongDetailed](./SongDetailed.html)`, "duration">[]` | Top Songs from Artist |
|
||||||
| topAlbums | [AlbumDetailed](./AlbumDetailed.html)`[]` | Top Albums from Artist |
|
| topAlbums | [AlbumDetailed](./AlbumDetailed.html)`[]` | Top Albums from Artist |
|
||||||
|
|
||||||
|
|
@ -22,7 +21,6 @@ interface ArtistFull {
|
||||||
name: string
|
name: string
|
||||||
thumbnails: ThumbnailFull[]
|
thumbnails: ThumbnailFull[]
|
||||||
description: string
|
description: string
|
||||||
subscribers: number
|
|
||||||
topSongs: Omit<SongDetailed, "duration">[]
|
topSongs: Omit<SongDetailed, "duration">[]
|
||||||
topAlbums: AlbumDetailed[]
|
topAlbums: AlbumDetailed[]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ytmusic-api",
|
"name": "ytmusic-api",
|
||||||
"version": "2.0.0",
|
"version": "3.0.0",
|
||||||
"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",
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ export interface ArtistDetailed extends ArtistBasic {
|
||||||
|
|
||||||
export interface ArtistFull extends ArtistDetailed {
|
export interface ArtistFull extends ArtistDetailed {
|
||||||
description: string
|
description: string
|
||||||
subscribers: number
|
|
||||||
topSongs: Omit<SongDetailed, "duration">[]
|
topSongs: Omit<SongDetailed, "duration">[]
|
||||||
topAlbums: AlbumDetailed[]
|
topAlbums: AlbumDetailed[]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ export const ARTIST_FULL: ObjectValidator<ArtistFull> = OBJECT({
|
||||||
type: STRING("ARTIST"),
|
type: STRING("ARTIST"),
|
||||||
thumbnails: LIST(THUMBNAIL_FULL),
|
thumbnails: LIST(THUMBNAIL_FULL),
|
||||||
description: STRING(),
|
description: STRING(),
|
||||||
subscribers: NUMBER(),
|
|
||||||
topSongs: LIST(
|
topSongs: LIST(
|
||||||
OBJECT({
|
OBJECT({
|
||||||
type: STRING("SONG"),
|
type: STRING("SONG"),
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import checkType from "../utils/checkType"
|
||||||
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"
|
||||||
import Parser from "./Parser"
|
|
||||||
import SongParser from "./SongParser"
|
import SongParser from "./SongParser"
|
||||||
|
|
||||||
export default class ArtistParser {
|
export default class ArtistParser {
|
||||||
|
|
@ -22,9 +21,6 @@ export default class ArtistParser {
|
||||||
...artistBasic,
|
...artistBasic,
|
||||||
thumbnails: traverseList(data, "header", "thumbnails"),
|
thumbnails: traverseList(data, "header", "thumbnails"),
|
||||||
description,
|
description,
|
||||||
subscribers: Parser.parseNumber(
|
|
||||||
traverseString(data, "subscriberCountText", "text")()
|
|
||||||
),
|
|
||||||
topSongs: traverseList(data, "musicShelfRenderer", "contents").map(item =>
|
topSongs: traverseList(data, "musicShelfRenderer", "contents").map(item =>
|
||||||
SongParser.parseArtistTopSong(item, artistBasic)
|
SongParser.parseArtistTopSong(item, artistBasic)
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue