Commit 5eacaed3 authored by Jonas Haraldsson's avatar Jonas Haraldsson

Limit checkDupe to 40 latest tracks in playlist

parent ea402fac
......@@ -357,8 +357,9 @@ function getRadioPlaylist() {
*/
function checkDupe(playlist, creator, title) {
var i;
for(i in playlist) {
if(playlist[i].artist === creator && playlist[i].track === title) {
var pl = playlist.slice(-40); //only check against 40 latest tracks in playlist
for(i in pl) {
if(pl[i].artist === creator && pl[i].track === title) {
return i;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment