anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: spotdl/spotify-downloader
Issue: Similar named track already downloaded prompts about overwriting

If a track whose filename comes in a track which has been already been downloaded we get prompted about overwriting the old track. For example, this is a false positive case:

```
$ python3 spotdl.py -s "nightcore - uncover you"
INFO: Nightcore - Uncover You - (Lyrics) (http://www.youtube.com/watch?v=9B8yuzO5HkU)
WARNING: Could not find metadata
  3,231,717.0 Bytes [100.00%] received. Rate: [1020 KB/s].  ETA: [0 secs]    
INFO: Converting Nightcore - Uncover You - (Lyrics).m4a to mp3

$ ls ~/Music/
'Nightcore - Uncover You - (Lyrics).mp3'

$ python3 spotdl.py -s "nightcore - uncover"
INFO: Nightcore - Uncover (http://www.youtube.com/watch?v=Dz3C_EDx2kE)
WARNING: Could not find metadata
WARNING: "Nightcore - Uncover You - (Lyrics).mp3" already exists
INFO: "Nightcore - Uncover You - (Lyrics).mp3" has already been downloaded. Re-download? (y/N): 
> y
  3,133,515.0 Bytes [100.00%] received. Rate: [ 1830 KB/s].  ETA: [0 secs]    
INFO: Converting Nightcore - Uncover.m4a to mp3

$ ls ~/Music/
'Nightcore - Uncover.mp3'
```

These are two different nightcore tracks. The first track's filename is "Nightcore - Uncover You - (Lyrics)" while second track's filename is "Nightcore - Uncover" and by our current logic, it would end up assuming same track has been already been downloaded.
```python
>>>  "Nightcore - Uncover" in "Nightcore - Uncover You - (Lyrics)"
True
```

We need to refactor our function which checks for duplicate filenames and possibly even add a regression test.

Changed files:
spotdl.py

diff --git a/spotdl.py b/spotdl.py
index b52cea0d..cadfce51 100755
--- a/spotdl.py
+++ b/spotdl.py
@@ -28,8 +28,8 @@ def check_exists(music_file, raw_song, meta_tags):
         if song.endswith('.temp'):
             os.remove(os.path.join(const.args.folder, song))
             continue
-        # check if any song with similar name is already present in the given folder
-        if song.startswith(music_file):
+        # check if a song with the same name is already present in the given folder
+        if song == os.path.splitext(music_file)[0]:
             log.debug('Found an already existing song: "{}"'.format(song))
             if internals.is_spotify(raw_song):
                 # check if the already downloaded song has correct metadata