'use strict';

/* global Connector, MetadataFilter */

if (location.href === 'http://bandzone.cz/' || location.href === 'https://bandzone.cz/') {
	Connector.playerSelector = '#stats';

	Connector.artistSelector = '.stat:has(.ui-miniaudioplayer-state-playing) h4';

	Connector.trackSelector = '.stat:has(.ui-miniaudioplayer-state-playing) .songTitle';

	Connector.isPlaying = function () {
		return $('.ui-miniaudioplayer-state-playing').length;
	};
} else {
	Connector.playerSelector = '#playerWidget';

	Connector.artistSelector = '.profile-name h1';

	Connector.trackSelector = '.ui-state-active .ui-audioplayer-song-title';

	Connector.isPlaying = function () {
		return $('.ui-audioplayer-button').text() === 'stop';
	};

	Connector.getCurrentTime = function() {
		var currentTimeStr = getSongInfo(INFO_CURRENT_TIME);
		return Connector.stringToSeconds(currentTimeStr);
	};

	Connector.getDuration = function() {
		var durationStr = getSongInfo(INFO_DURATION);
		return Connector.stringToSeconds(durationStr);
	};

	Connector.filter = new MetadataFilter({
		all: MetadataFilter.trim,
		artist: removeGenre
	});

	var INFO_CURRENT_TIME = 1;
	var INFO_DURATION = 2;
	var getSongInfo = function(field) {
		var infoStr = $('.ui-audioplayer-time').text();
		var pattern = /(.+)\s\/\s(.+)/gi;
		return pattern.exec(infoStr)[field];
	};

	var removeGenre = function(text) {
		var genre = $('.profile-name span').text();
		return text.replace(genre, '');
	};
}

@@ -1004,32 +1004,153 @@
 ationStr);%0A%09%7D;%0A%0A
+%09var removeGenre = function(text) %7B%0A%09%09var genre = $('.profile-name span').text();%0A%09%09return text.replace(genre, '');%0A%09%7D;%0A%0A
 %09Connector.filte
@@ -1451,128 +1451,7 @@
 %0A%09%7D;
-%0A%0A%09var removeGenre = function(text) %7B%0A%09%09var genre = $('.profile-name span').text();%0A%09%09return text.replace(genre, '');%0A%09%7D;
 %0A%7D%0A

Fix fetching artist in Bandzone connector