self.queue_track_list.append(self.track_name.lower()) #NOTE Add the tracks Track Name to a list as lower case #NOTE This is done elswhere in my script ======================================================================================================================================================= if self.played_artist in self.queue_artist_name_list: #may need to adjust this per track?? track_title = self.played_name[:12] #NOTE Get the first 12 characters of the Track Name #NOTE This may need to be adjusted if too many issues found #NOTE Possibly set it on a "per track" basis?? track_title = track_title.lower() #NOTE Make it all lower case test_list = self.queue_track_list #NOTE Copy the track lis to a temp list r = [s for s in test_list if s.startswith(track_title)] #NOTE Look for a match in the list with the first 12 characters of the track title #NOTE Don't ask me how it works ?????????? r[0] if r else 'nomatch' #NOTE The results if r: #NOTE If the track is found in the queue self.ai = self.queue_artist_name_list.index(self.played_artist) #NOTE Get the position in the queue list self.track_uri = self.queue_list[self.ai] #NOTE Get the URI of the original track (use this to remove the track) else: continue #NOTE If it's not found do something else (continue just moves to the next track at the moment)