Spotify tracksCount name error fixed

This commit is contained in:
killer069 2021-10-18 15:38:05 +05:30
parent c676d52781
commit 35dcb7288d

View File

@ -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++) {