static addFilter(key, value) {

		switch(key) {
			case "artist":
				this.filters.artists = value.toLowerCase();
				break;
			case "not-artist":
				this.filters.notArtists = value.toLowerCase();
				break;
			case "label":
				this.filters.labels = value.toLowerCase();
				break;
			case "not-label":
				this.filters.notLabels = value.toLowerCase();
				break;
			case "min-labels":
				this.filters.gteXLabels = value.toLowerCase();
				break;
			case "max-labels":
				this.filters.lteXLabels = value.toLowerCase();
				break;
			case "track":
				this.filters.tracks = value.toLowerCase();
				break;
			case "added-before":
				const addedBefore = (value ? new Date(value) : new Date(9999, 1, 1));
				this.filters.addedBefore = (addedBefore.getFullYear() < 1000 ? new Date(9999, 1, 1) : addedBefore.setHours(23, 59, 59, 999));
				break;
			case "added-after":
				const addedAfter = (value ? new Date(value) : new Date(1000, 1, 1));
				this.filters.addedAfter = (addedAfter.getFullYear() < 1000 ? new Date(1000, 1, 1) : addedAfter.setHours(0, 0, 0, 0));
				break;
			case "released-before":
				const releasedBefore = (value ? new Date(value) : new Date(9999, 1, 1));
				this.filters.releasedBefore = (releasedBefore.getFullYear() < 1000 ? new Date(9999, 1, 1) : releasedBefore.setHours(23, 59, 59, 999));
				break;
			case "released-after":
				const releasedAfter = (value ? new Date(value) : new Date(1000, 1, 1));
				this.filters.releasedAfter = (releasedAfter.getFullYear() < 1000 ? new Date(1000, 1, 1) : releasedAfter.setHours(0, 0, 0, 0));
				break;
		}

		return this.filter();

	}
/**
	 * Adds or changes a filter to the list of tracks
	 * 
	 * @param {string} key What to filter on (e.g., artist, track name, date added, ...)
	 * @param {string} value What value to filter on
	 * @returns the filtered array
	 */
Adds or changes a filter to the list of tracks

@param {string} key What to filter on
@param {string} value What value to filter on
@returns the filtered array
Adds or changes a filter to the list of tracks @param { string } key What to filter on @param { string } value What value to filter on @returns the filtered array
static addFilter(key, value) {
		switch(key) {
			case "artist":
				this.filters.artists = value.toLowerCase();
				break;
			case "not-artist":
				this.filters.notArtists = value.toLowerCase();
				break;
			case "label":
				this.filters.labels = value.toLowerCase();
				break;
			case "not-label":
				this.filters.notLabels = value.toLowerCase();
				break;
			case "min-labels":
				this.filters.gteXLabels = value.toLowerCase();
				break;
			case "max-labels":
				this.filters.lteXLabels = value.toLowerCase();
				break;
			case "track":
				this.filters.tracks = value.toLowerCase();
				break;
			case "added-before":
				const addedBefore = (value ? new Date(value) : new Date(9999, 1, 1));
				this.filters.addedBefore = (addedBefore.getFullYear() < 1000 ? new Date(9999, 1, 1) : addedBefore.setHours(23, 59, 59, 999));
				break;
			case "added-after":
				const addedAfter = (value ? new Date(value) : new Date(1000, 1, 1));
				this.filters.addedAfter = (addedAfter.getFullYear() < 1000 ? new Date(1000, 1, 1) : addedAfter.setHours(0, 0, 0, 0));
				break;
			case "released-before":
				const releasedBefore = (value ? new Date(value) : new Date(9999, 1, 1));
				this.filters.releasedBefore = (releasedBefore.getFullYear() < 1000 ? new Date(9999, 1, 1) : releasedBefore.setHours(23, 59, 59, 999));
				break;
			case "released-after":
				const releasedAfter = (value ? new Date(value) : new Date(1000, 1, 1));
				this.filters.releasedAfter = (releasedAfter.getFullYear() < 1000 ? new Date(1000, 1, 1) : releasedAfter.setHours(0, 0, 0, 0));
				break;
		}
		return this.filter();
	}
static addFilter ( key , value ) { switch ( key ) { case "artist" : this . filters . artists = value . toLowerCase ( ) ; break ; case "not-artist" : this . filters . notArtists = value . toLowerCase ( ) ; break ; case "label" : this . filters . labels = value . toLowerCase ( ) ; break ; case "not-label" : this . filters . notLabels = value . toLowerCase ( ) ; break ; case "min-labels" : this . filters . gteXLabels = value . toLowerCase ( ) ; break ; case "max-labels" : this . filters . lteXLabels = value . toLowerCase ( ) ; break ; case "track" : this . filters . tracks = value . toLowerCase ( ) ; break ; case "added-before" : const addedBefore = ( value ? new Date ( value ) : new Date ( 9999 , 1 , 1 ) ) ; this . filters . addedBefore = ( addedBefore . getFullYear ( ) < 1000 ? new Date ( 9999 , 1 , 1 ) : addedBefore . setHours ( 23 , 59 , 59 , 999 ) ) ; break ; case "added-after" : const addedAfter = ( value ? new Date ( value ) : new Date ( 1000 , 1 , 1 ) ) ; this . filters . addedAfter = ( addedAfter . getFullYear ( ) < 1000 ? new Date ( 1000 , 1 , 1 ) : addedAfter . setHours ( 0 , 0 , 0 , 0 ) ) ; break ; case "released-before" : const releasedBefore = ( value ? new Date ( value ) : new Date ( 9999 , 1 , 1 ) ) ; this . filters . releasedBefore = ( releasedBefore . getFullYear ( ) < 1000 ? new Date ( 9999 , 1 , 1 ) : releasedBefore . setHours ( 23 , 59 , 59 , 999 ) ) ; break ; case "released-after" : const releasedAfter = ( value ? new Date ( value ) : new Date ( 1000 , 1 , 1 ) ) ; this . filters . releasedAfter = ( releasedAfter . getFullYear ( ) < 1000 ? new Date ( 1000 , 1 , 1 ) : releasedAfter . setHours ( 0 , 0 , 0 , 0 ) ) ; break ; } return this . filter ( ) ; }
Adds or changes a filter to the list of tracks
Adds or changes a filter to the list of tracks