Duplicates showing up in playlist #244
-
Hi there, I have a playlist that is sorted based on when I last played a track with the most recently played going to the bottom of the playlist. This has worked fine for a while but there are two songs which are causing me a headache, both conveniently by the same artist: ALASKALASKA.
In the resulting array, there are songs called "Monster" and "Meateater" which appear twice. One copy of the songs follows the playlist's rules but the other just sits at the top of the playlist. Both copies have different URIs even though I have only liked one copy of each song. Monster: spotify:track:5ZpPxBttRqSRMa8aim3gzJ, spotify:track:4wD7e5tXLowG9XnANZIKo1 Any help would be appreciated because it's messing up my morning playlist and annoying me! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When tracks are different ids and the same names, dedupTracks function looks at duration. If the offset is too much, the tracks are considered different. For example, In order to remove such cases, the function has the second argument Just add some offset:
|
Beta Was this translation helpful? Give feedback.
When tracks are different ids and the same names, dedupTracks function looks at duration. If the offset is too much, the tracks are considered different. For example,
monster
has 3:56 and 3:53,meateater
has 4:25 and 4:22.In order to remove such cases, the function has the second argument
offsetDurationMs
(by default 2000 ms). As you can see, the tracks have more than 2 seconds offset. Thus they hold on.Just add some offset: