'use strict';

setupConnector();

function setupConnector() {
	setupCommonProperties();

	if (isMiniPlayer()) {
		Util.debugLog('Setup properties for mini player');

		setupPropertiesForMiniPlayer();
	} else {
		Util.debugLog('Setup properties for full player');

		setupPropertiesForFullPlayer();
	}
}

function isMiniPlayer() {
	return location.hostname === 'app.pretzel.rocks';
}

function setupCommonProperties() {
	const filter = MetadataFilter.createFilter({
		track: MetadataFilter.fixTrackSuffix,
		album: MetadataFilter.fixTrackSuffix,
	});

	Connector.applyFilter(filter);
}

// https://app.pretzel.rocks
function setupPropertiesForMiniPlayer() {
	const artistSelector = '.kkKxss p:nth-child(2) .CIWgt';

	Connector.playerSelector = '.eLgAlM';

	Connector.trackSelector = '.bPhEWg';

	Connector.albumSelector = '.kkKxss p:nth-child(3) .CIWgt';

	Connector.pauseButtonSelector = '.pretzel-icon-pause';

	Connector.trackArtSelector = '.rgUOX';

	Connector.currentTimeSelector = '.foNsgO p:nth-child(1)';

	Connector.durationSelector = '.foNsgO p:nth-child(2)';

	Connector.getArtist = () => getArtistsFromElement(artistSelector);
}

// https://play.pretzel.rocks/
function setupPropertiesForFullPlayer() {
	const artistSelector = '.kzpiRD p:nth-child(2) a';

	Connector.playerSelector = '.hOOKvw';

	Connector.trackSelector = '.kzpiRD .oKpSL';

	Connector.albumSelector = '.kzpiRD p:nth-child(3) a';

	Connector.playButtonSelector = '.pretzel-icon-player_play';

	Connector.trackArtSelector = '.rwQJb img';

	Connector.currentTimeSelector = '.hcriLb p:nth-child(1)';

	Connector.durationSelector = '.hcriLb p:nth-child(3)';

	Connector.getArtist = () => getArtistsFromElement(artistSelector);
}

function getArtistsFromElement(selector) {
	const artistElements = document.querySelectorAll(selector);
	return Util.joinArtists(Array.from(artistElements));
}

@@ -12,413 +12,8 @@
 ';%0A%0A
-setupConnector();%0A%0Afunction setupConnector() %7B%0A%09setupCommonProperties();%0A%0A%09if (isMiniPlayer()) %7B%0A%09%09Util.debugLog('Setup properties for mini player');%0A%0A%09%09setupPropertiesForMiniPlayer();%0A%09%7D else %7B%0A%09%09Util.debugLog('Setup properties for full player');%0A%0A%09%09setupPropertiesForFullPlayer();%0A%09%7D%0A%7D%0A%0Afunction isMiniPlayer() %7B%0A%09return location.hostname === 'app.pretzel.rocks';%0A%7D%0A%0Afunction setupCommonProperties() %7B%0A%09
 cons
@@ -53,17 +53,16 @@
 ilter(%7B%0A
-%09
 %09track: 
@@ -92,17 +92,16 @@
 Suffix,%0A
-%09
 %09album: 
@@ -135,15 +135,13 @@
 ix,%0A
-%09
 %7D);%0A%0A
-%09
 Conn
@@ -171,640 +171,9 @@
 r);%0A
-%7D%0A%0A// https://app.pretzel.rocks%0Afunction setupPropertiesForMiniPlayer() %7B%0A%09const artistSelector = '.kkKxss p:nth-child(2) .CIWgt';%0A%0A%09Connector.playerSelector = '.eLgAlM';%0A%0A%09Connector.trackSelector = '.bPhEWg';%0A%0A%09Connector.albumSelector = '.kkKxss p:nth-child(3) .CIWgt';%0A%0A%09Connector.pauseButtonSelector = '.pretzel-icon-pause';%0A%0A%09Connector.trackArtSelector = '.rgUOX';%0A%0A%09Connector.currentTimeSelector = '.foNsgO p:nth-child(1)';%0A%0A%09Connector.durationSelector = '.foNsgO p:nth-child(2)';%0A%0A%09Connector.getArtist = () =%3E getArtistsFromElement(artistSelector);%0A%7D%0A%0A// https://play.pretzel.rocks/%0Afunction setupPropertiesForFullPlayer() %7B%0A%09
+%0A
 cons
@@ -216,25 +216,24 @@
 ild(2) a';%0A%0A
-%09
 Connector.pl
@@ -255,25 +255,24 @@
 '.hOOKvw';%0A%0A
-%09
 Connector.tr
@@ -300,25 +300,24 @@
 D .oKpSL';%0A%0A
-%09
 Connector.al
@@ -355,25 +355,24 @@
 ild(3) a';%0A%0A
-%09
 Connector.pl
@@ -416,25 +416,24 @@
 yer_play';%0A%0A
-%09
 Connector.tr
@@ -460,25 +460,24 @@
 wQJb img';%0A%0A
-%09
 Connector.cu
@@ -519,25 +519,24 @@
 child(1)';%0A%0A
-%09
 Connector.du
@@ -579,17 +579,16 @@
 d(3)';%0A%0A
-%09
 Connecto
@@ -645,18 +645,16 @@
 lector);
-%0A%7D
 %0A%0Afuncti

Update pretzel connector