From 75283af66d2343bf107d4f9c601a4afcd3a5002b Mon Sep 17 00:00:00 2001 From: elpoep Date: Wed, 6 Nov 2024 02:34:01 +0300 Subject: [PATCH] checks for duplicates --- elpAudio/scripts/GetMusicFromFolder.gml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/elpAudio/scripts/GetMusicFromFolder.gml b/elpAudio/scripts/GetMusicFromFolder.gml index 93c68bc..f8a74d9 100644 --- a/elpAudio/scripts/GetMusicFromFolder.gml +++ b/elpAudio/scripts/GetMusicFromFolder.gml @@ -10,15 +10,14 @@ if directory_exists(global.dirr) { // ALL FILES mus[0]=file_find_first(global.dirr+exts,findfile); if mus[0]!='' { - if FileIsSupported(mus[0]) ds_list_add(global.list,global.dirr+mus[0]); + if FileIsSupported(mus[0]) {ii=0 rep=0 repeat(ds_list_size(global.list)) {if ds_list_find_value(global.list,ii)==global.dirr+mus[0] rep=1 ii+=1} if !rep ds_list_add(global.list,global.dirr+mus[0])}; repeat(2048) { mus[i]=file_find_next(); if mus[i]!='' { - if FileIsSupported(mus[i]) ds_list_add(global.list,global.dirr+mus[i]); + if FileIsSupported(mus[i]) {ii=0 rep=0 repeat(ds_list_size(global.list)) {if ds_list_find_value(global.list,ii)==global.dirr+mus[i] rep=1 ii+=1} if !rep ds_list_add(global.list,global.dirr+mus[i])}; i+=1 } else break; } } file_find_close() - global.thesong=ds_list_find_value(global.list,0) }