//All we need to do is override some of the info for tracklistFieldDefs
window.uitools.tracklistFieldDefs.rating = {
	title: _('Rating'),
	disabled: false,
	checked: false,
	bindData: function (div, item) {
		//Ratings are saved from 0 to 100, with -1 as unknown
		div.textContent = (item.rating == -1) ? '' : item.rating / 20;
	},
	getValue: function (item) {
		console.log(this);
		//Only mess with the values in the context of the tracklist. 
		//	If anywhere else in the code tries to access the getter, it'll return the normal (unmodified) value.
		if (this instanceof window.Column)
			return (item.rating == -1) ? '' : item.rating / 20;
		else
			return item.rating;
	},
	setValue: function (item, newValue) {
		//Only mess with the values in the context of the tracklist, i.e. "this" variable is an instance of window.Column
		if (this instanceof window.Column) {
			console.log('I AM COLUMN');
			var actualRating;
			if (newValue.trim() == '') actualRating = -1;
			else {
				//Multiply by 4 and round to get the nearest 0.25
				let numericVal = Math.round(parseFloat(newValue) * 4);
				//Then, multiply by 5 to get to the 0-100 rating
				actualRating = numericVal * 5;
				//Set it to min at -1 and max at 100
				if (actualRating < 0) actualRating = -1; //check if < 0 to avoid -0.25 to -0.75
				if (actualRating > 100) actualRating = 100;
				//Only update if it's a real number
				if (!isNaN(actualRating)) return checkAndUpdateValue(item, 'rating', actualRating);
				//If invalid, set to -1
				else return checkAndUpdateValue(item, 'rating', -1);
			}
		}
		//If anywhere else in the code tries to access the getter, it'll update value as normal instead of using the custom code
		else {
			console.log('I AM NOT COLUMN');
            return checkAndUpdateValue(item, 'rating', newValue);
		}
	},
	width: '2.5em',
	minWidth: '1em',
	align: 'right',
	editor: editors.gridViewEditors.multiValueEdit,
	mask: 'ZR'
};