summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlshprung <lshprung@yahoo.com>2021-10-10 20:31:51 -0700
committerlshprung <lshprung@yahoo.com>2021-10-10 20:31:51 -0700
commit529a1a41d60b14293331d282eee8ab103fe41091 (patch)
tree8bd84559c390dde82c7860b38f476032d856236c
parent23829ef23b48c9c3c30c61acbcaccf460e81957e (diff)
sort when adding files to db
-rwxr-xr-xbuild_db.plx3
1 files changed, 2 insertions, 1 deletions
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;