'use strict';

const adUrls = [
	'utm_source=display',
	'ad.doubleclick.net',
	'spotify:playlist',
	'shrt.spotify.com'
];

Connector.playerSelector = '.Root__now-playing-bar';

Connector.artistSelector = '.track-info__artists a';

Connector.trackSelector = '.Root__now-playing-bar .track-info__name a';

Connector.trackArtSelector = '.now-playing__cover-art .cover-art-image-loaded';

Connector.playButtonSelector = '.control-button[class*="spoticon-play-"]';

Connector.currentTimeSelector = '.Root__now-playing-bar .playback-bar__progress-time:first-child';

Connector.durationSelector = '.Root__now-playing-bar .playback-bar__progress-time:last-child';

Connector.applyFilter(MetadataFilter.getSpotifyFilter());

Connector.isScrobblingAllowed = () => !isAdPlaying();

Connector.isPodcast = () => artistUrlIncludes('/show/');

function isAdPlaying() {
	for (const adUrl of adUrls) {
		if (artistUrlIncludes(adUrl)) {
			return true;
		}
	}

	return false;
}

function artistUrlIncludes(str) {
	const artistUrl = $(Connector.artistSelector).attr('href');
	return artistUrl && artistUrl.includes(str);
}

@@ -12,116 +12,8 @@
 ';%0A%0A
-const adUrls = %5B%0A%09'utm_source=display',%0A%09'ad.doubleclick.net',%0A%09'spotify:playlist',%0A%09'shrt.spotify.com'%0A%5D;%0A%0A
 Conn
@@ -744,109 +744,55 @@
  %7B%0A%09
-for (const adUrl of adUrls) %7B%0A%09%09if (artistUrlIncludes(adUrl)) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%7D%0A%0A%09return false
+return !artistUrlIncludes('/artist/', '/show/')
 ;%0A%7D%0A
@@ -819,19 +819,26 @@
 ncludes(
-str
+...strings
 ) %7B%0A%09con
@@ -894,24 +894,22 @@
 href');%0A
-%09return 
+%0A%09if (
 artistUr
@@ -913,35 +913,120 @@
 tUrl
- && artistUrl.includes(str)
+) %7B%0A%09%09for (const str of strings) %7B%0A%09%09%09if (artistUrl.includes(str)) %7B%0A%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09return false
 ;%0A%7D%0A

Update spotify connector