'use strict';

/* global Connector */

Connector.playerSelector = '.omniplayer';

Connector.isPlaying = function() {
	return $('.omniplayer').hasClass('is-playing');
};

Connector.getArtistTrack = function () {
	var artist_all = $('.omniplayer--artist').text().trim().replace(/\s+/g, ' ');
	var artist_first = $('.omniplayer--artist a:nth-child(1)').text().trim();

	var track_clean = $('.omniplayer--title').clone().children().remove().end().text().trim();
	var track_mix = $('.omniplayer--title').clone().children().text().trim();
	var trackmix = track_clean + ' (' + track_mix + ')';

	/* this is remix tracks, like:
	 * [ Artist1, Artist2 - Trackname <Artist2 remix> ]
	 * return first artist and track with mix mark
	 */
	var artist = artist_first || null;
	var track = trackmix || null;

	/* this is normal track, like:
	 * [ Artist1, Artist2 - Trackname <Original Mix> ]
	 * return all artists and track without mix mark
	 */
	if (track_mix == 'Original Mix') {
		artist = artist_all || null;
		track = track_clean || null;
	}

	return {artist: artist, track: track};
};

Connector.trackArtImageSelector = '.omniplayer--control img:nth-child(1)';

@@ -61,24 +61,30 @@
 tor = '.
-omni
 play
+er-contain
 er';%0A%0ACo
@@ -95,83 +95,75 @@
 tor.
-isPlaying = function() %7B%0A%09return $('.omniplayer').hasClass('is-playing');%0A%7D
+artistSelector = '.player-track-name-artist-standard .track-artist'
 ;%0A%0AC
@@ -174,22 +174,16 @@
 ctor.get
-Artist
 Track = 
@@ -190,17 +190,16 @@
 function
- 
 () %7B%0A%09va
@@ -204,942 +204,550 @@
 var 
-artist_all
+trackName
  = $('.
-omni
 player-
--artist').text().trim().replace(/%5Cs+/g, ' ');%0A%09var artist_first = $('.omniplayer--artist a:nth-child(1)').text().trim
+track-name-artist-standard .primary-title').text
 ();%0A
-%0A
 %09var 
-track_clean
+remixedBy
  = $('.
-omni
 player-
--title').clone().children().remove().end().text().trim();%0A%09var track_mix = $('.omniplayer--title').clone().children().text().trim();%0A%09var trackmix = track_clean + ' (' + track_mix + ')';%0A%0A%09/* this is remix tracks, like:%0A%09 * %5B Artist1, Artist2 - Trackname %3CArtist2 remix%3E %5D%0A%09 * return first artist and track with mix mark%0A%09 */%0A%09var artist = artist_first %7C%7C null;%0A%09var track = trackmix %7C%7C null;%0A%0A%09/* this is normal track, like:%0A%09 * %5B Artist1, Artist2 - Trackname %3COriginal Mix%3E %5D%0A%09 * return all artists and track without mix mark%0A%09 */%0A%09if (track_mix == 'Original Mix') %7B%0A%09%09artist = artist_all %7C%7C null;%0A%09%09track = track_clean %7C%7C null;%0A%09%7D%0A%0A%09return %7Bartist: artist, track: track%7D;%0A%7D;%0A%0AConnector.trackArtImageSelector = '.omni
+track-name-artist-standard .remixed').text();%0A%09if (remixedBy === 'Original Mix') %7B%0A%09%09return trackName;%0A%09%7D%0A%09return trackName + ' (' + remixedBy + ')';%0A%7D;%0A%0AConnector.getUniqueID = function() %7B%0A%09var trackUrl = $('.player-current-track-container a').attr('href');%0A%09var index = trackUrl.lastIndexOf('/');%0A%09return trackUrl.substring(index + 1);%0A%7D;%0A%0AConnector.isPlaying = function() %7B%0A%09return $('.
 player-
--
 control
- img:nth-child(1)'
+s .play-button').hasClass('pause');%0A%7D
 ;%0A

Fix Beatport connector