public static void NextSong()
 {
     SpotifyLocalAPI _spotify = new SpotifyLocalAPI();
     if (!_spotify.Connect())
     {
         return;
     }
     _spotify.Skip();
     _spotify = null;
 }
        public void Execute(IJobExecutionContext context)
        {
            SpotifyModel sm = new SpotifyModel();
            _auth = new ImplicitGrantAuth
            {
                RedirectUri = "http://localhost:8000",
                ClientId = "26d287105e31491889f3cd293d85bfea",
                Scope =
                    Scope.UserReadPrivate | Scope.UserReadEmail | Scope.PlaylistReadPrivate | Scope.UserLibrarayRead |
                    Scope.UserReadPrivate | Scope.UserFollowRead | Scope.UserReadBirthdate,
                State = "XSS"
            };
            _auth.OnResponseReceivedEvent += _auth_OnResponseReceivedEvent;

            _auth.StartHttpServer(8000);
            _auth.DoAuth();

            _spotifyLocal = new SpotifyLocalAPI();

            if (!SpotifyLocalAPI.IsSpotifyRunning())
            {
                return;
            }
            if (!SpotifyLocalAPI.IsSpotifyWebHelperRunning())
            {
                return;
            }

            bool successful = _spotifyLocal.Connect();
            if (successful)
            {
                UpdateInfos();
                SpotifyModel spotifyModel = new SpotifyModel();
                var dictDetails = GetDictionaryDetails(_currentTrack.TrackResource.Name).Keys.ToList();
                if (Winner)
                {
                    dictDetails.Sort();
                    var winner = dictDetails[0];
                    var temp = "";
                    if (_currentTrack.TrackType != "ad")
                    {
                        temp = _currentTrack.TrackResource.Name + " - " + _currentTrack.ArtistResource.Name;
                    }
                    while (!temp.Equals(winner))
                    {
                        _spotifyLocal.Skip();
                        UpdateInfos();
                        temp = _currentTrack.TrackResource.Name + " - " + _currentTrack.ArtistResource.Name;
                        Thread.Sleep(100);
                    }
                    Winner = false;
                    spotifyModel.Truncate();
                }
            }
        }