From 529a1a41d60b14293331d282eee8ab103fe41091 Mon Sep 17 00:00:00 2001 From: lshprung Date: Sun, 10 Oct 2021 20:31:51 -0700 Subject: sort when adding files to db --- build_db.plx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build_db.plx') diff --git a/build_db.plx b/build_db.plx index 4f5bcad..945367f 100755 --- a/build_db.plx +++ b/build_db.plx @@ -20,6 +20,7 @@ our $table_name = "LIBRARY"; our $extensions_list = "flac,mp3,ogg"; our %extensions; +# TODO add depth flag # Keep track of options that have been set our %options = ( append => 0, @@ -61,7 +62,7 @@ sub get_files { my $extensions = $_[1]; opendir my $dh, "$dir_path" or die "$!"; - while (my $file = readdir($dh)) { + foreach my $file(sort readdir($dh)) { # Skip . and .. directories if ($file eq "." or $file eq ".."){ next; -- cgit