Spotify tracksCount name error fixed
This commit is contained in:
parent
c676d52781
commit
35dcb7288d
@ -200,7 +200,7 @@ export class SpotifyAlbum {
|
|||||||
copyrights: SpotifyCopyright[];
|
copyrights: SpotifyCopyright[];
|
||||||
release_date: string;
|
release_date: string;
|
||||||
release_date_precision: string;
|
release_date_precision: string;
|
||||||
trackCount: number;
|
tracksCount: number;
|
||||||
private spotifyData: SpotifyDataOptions;
|
private spotifyData: SpotifyDataOptions;
|
||||||
private fetched_tracks: Map<string, SpotifyTrack[]>;
|
private fetched_tracks: Map<string, SpotifyTrack[]>;
|
||||||
constructor(data: any, spotifyData: SpotifyDataOptions) {
|
constructor(data: any, spotifyData: SpotifyDataOptions) {
|
||||||
@ -221,7 +221,7 @@ export class SpotifyAlbum {
|
|||||||
this.copyrights = data.copyrights;
|
this.copyrights = data.copyrights;
|
||||||
this.release_date = data.release_date;
|
this.release_date = data.release_date;
|
||||||
this.release_date_precision = data.release_date_precision;
|
this.release_date_precision = data.release_date_precision;
|
||||||
this.trackCount = data.total_tracks;
|
this.tracksCount = data.total_tracks;
|
||||||
const videos: SpotifyTrack[] = [];
|
const videos: SpotifyTrack[] = [];
|
||||||
data.tracks.items.forEach((v: any) => {
|
data.tracks.items.forEach((v: any) => {
|
||||||
videos.push(new SpotifyTrack(v));
|
videos.push(new SpotifyTrack(v));
|
||||||
@ -233,8 +233,8 @@ export class SpotifyAlbum {
|
|||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
let fetching: number;
|
let fetching: number;
|
||||||
if (this.trackCount > 500) fetching = 500;
|
if (this.tracksCount > 500) fetching = 500;
|
||||||
else fetching = this.trackCount;
|
else fetching = this.tracksCount;
|
||||||
if (fetching <= 50) return;
|
if (fetching <= 50) return;
|
||||||
const work = [];
|
const work = [];
|
||||||
for (let i = 2; i <= Math.ceil(fetching / 50); i++) {
|
for (let i = 2; i <= Math.ceil(fetching / 50); i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user