UNPKG

pipebomb.js

Version:

Library for interacting with Pipe Bomb servers

41 lines 1.34 kB
export default class TrackList { constructor(collectionCache, collectionID, collectionName, trackList, service, thumbnail) { this.thumbnail = null; this.collectionID = collectionID; this.collectionName = collectionName; this.trackList = trackList; if (service) this.service = service; if (thumbnail) this.thumbnail = thumbnail; collectionCache.setCollection(this); } getTrackList() { if (!this.trackList) return null; return Array.from(this.trackList); } copyFromOtherTrackList(trackList) { let changed = false; if (trackList.trackList !== null) { if (this.trackList !== null && this.trackList.length == trackList.trackList.length) { for (let i = 0; i < this.trackList.length; i++) { if (this.trackList[i].trackID != trackList.trackList[i].trackID) { changed = true; break; } } } else { changed = true; } } if (trackList.trackList) { this.trackList = trackList.trackList; } } getName() { return this.collectionName; } } //# sourceMappingURL=TrackList.js.map