<commit_before>'use strict';

function setupNewPandoraPlayer() {
	Connector.playerSelector = '.region-bottomBar';

	Connector.artistSelector = '.Tuner__Audio__TrackDetail__artist';

	Connector.trackSelector = '.Tuner__Audio__TrackDetail__title';

	Connector.durationSelector = 'span[data-qa="remaining_time"]';

	Connector.trackArtSelector = '.Tuner__Audio__TrackDetail__img img';

	Connector.getTrackArt = () => {
		let trackArtUrl = $('.Tuner__Audio__TrackDetail__img img').attr('src');
		if (trackArtUrl) {
			return trackArtUrl.replace('90W_90H', '500W_500H');
		}

		return null;
	};

	Connector.isPlaying = () => {
		let playButtonHref = $('.PlayButton use').attr('xlink:href');
		return playButtonHref.includes('pause');
	};

	Connector.isScrobblingAllowed = () => {
		return $('.Tuner__Audio__TrackDetail__title--ad').length === 0;
	};
}

function setupPandoraPlayer() {
	Connector.playerSelector = '#playbackControl';

	Connector.trackArtSelector = '.playerBarArt';

	Connector.albumSelector = 'a.playerBarAlbum';

	Connector.artistSelector = 'a.playerBarArtist';

	Connector.trackSelector = 'a.playerBarSong';

	Connector.playButtonSelector = 'div.playButton';

	Connector.getDuration = () => {
		return getElapsedTime() + getRemainingTime();
	};

	function getElapsedTime() {
		let timeStr = $('div.elapsedTime').text();
		return Util.stringToSeconds(timeStr);
	}

	function getRemainingTime() {
		// Remove 'minus' sign
		let timeStr = $('div.remainingTime').text().substring(1);
		return Util.stringToSeconds(timeStr);
	}
}

function isNewPandoraPlayer() {
	return $('#playbackControl').length === 0;
}

function setupConnector() {
	if (isNewPandoraPlayer()) {
		setupNewPandoraPlayer();
	} else {
		setupPandoraPlayer();
	}
}

setupConnector();
<commit_msg>Remove support for old Pandora UI<commit_after>'use strict';

Connector.playerSelector = '.region-bottomBar';

Connector.artistSelector = '.Tuner__Audio__TrackDetail__artist';

Connector.trackSelector = '.Tuner__Audio__TrackDetail__title';

Connector.durationSelector = 'span[data-qa="remaining_time"]';

Connector.trackArtSelector = '.Tuner__Audio__TrackDetail__img img';

Connector.getTrackArt = () => {
	let trackArtUrl = $('.Tuner__Audio__TrackDetail__img img').attr('src');
	if (trackArtUrl) {
		return trackArtUrl.replace('90W_90H', '500W_500H');
	}

	return null;
};

Connector.isPlaying = () => {
	let playButtonHref = $('.PlayButton use').attr('xlink:href');
	return playButtonHref.includes('pause');
};

Connector.isScrobblingAllowed = () => {
	return $('.Tuner__Audio__TrackDetail__title--ad').length === 0;
};

{'fraction_non_alphanumeric': 0.15349016583108369, 'fraction_numerical': 0.009255688391824142, 'mean_word_length': 5.844327176781003, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7518312', 'n_tokens_mistral': 897, 'n_tokens_neox': 861, 'n_words': 127}