Ignore errors from invalid directories

This commit is contained in:
prpr 2022-09-15 01:39:13 +01:00
parent 805b9ba2dc
commit c73a940bae
4 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ httpheader "application/json"
set dir [cgi_get dir "/media/My Video/test"] set dir [cgi_get dir "/media/My Video/test"]
puts "{" puts "{"
foreach file [readdir $dir] { foreach file [readdir -nocomplain $dir] {
if {[file extension $file] ne ".mp3"} continue if {[file extension $file] ne ".mp3"} continue
if {[catch { if {[catch {

View File

@ -24,7 +24,7 @@ foreach line [split $dutxt "\n"] {
} }
# Handle symbolic links. # Handle symbolic links.
foreach file [readdir $dir] { foreach file [readdir -nocomplain $dir] {
set file "$dir/$file" set file "$dir/$file"
if {[catch {set lk [file readlink $file]}]} continue if {[catch {set lk [file readlink $file]}]} continue

View File

@ -28,7 +28,7 @@ foreach dir $dirs {
if {!$auto} { puts "\[$dir\]" } if {!$auto} { puts "\[$dir\]" }
loadseries $dir loadseries $dir
foreach file [lsort -command dedupsort [readdir $dir]] { foreach file [lsort -command dedupsort [readdir -nocomplain $dir]] {
if {[file extension $file] ne ".nts"} { continue } if {[file extension $file] ne ".nts"} { continue }
set file "$dir/[file rootname $file].hmt" set file "$dir/[file rootname $file].hmt"

View File

@ -28,7 +28,7 @@ puts "<fieldset style=\"display: inline\">
loadseries $dir loadseries $dir
set recalc 0 set recalc 0
foreach file [lsort -command dedupsort [readdir $dir]] { foreach file [lsort -command dedupsort [readdir -nocomplain $dir]] {
set file "$dir/$file" set file "$dir/$file"
if {[file extension $file] ne ".nts"} { continue } if {[file extension $file] ne ".nts"} { continue }