We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 4bff5287 authored by Jonas Haraldsson's avatar Jonas Haraldsson

Limit checkDupe to 40 latest tracks in playlist

parent b3c23d8b
......@@ -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