hi i have this alias in my remotes and i was wondering if it can be made any better?
The way it is right now it seems a bit slow when I load my mp3s. Can anyone help ? I'll paste my script below :
alias mpeg.load {
%mpeg.l.total = $findfile(%mpeg.dir,*.mp3,0) | %mpeg.l.num = 0 | %mpeg.l.size = 0
:load
inc %mpeg.l.num 1 | if (%mpeg.l.num > %mpeg.l.total) { goto end }
else {
%mpeg.l.size = $calc($lof($findfile(%mpeg.dir,*.mp3,1)) + %mpeg.l.size)
goto load
}
:end
unset %mpeg.l.*
did -ra mpeg 4 dir: $+ $lower(%mpeg.dir)
set %mpeg.f.tot $findfile(%mpeg.dir,*.mp3,0)
unset %mpeg.f.inc
:grrr
inc %mpeg.f.inc
set %mpeg.f.file $findfile(%mpeg.dir,*.mp3,%mpeg.f.inc)
if (%mpeg.f.inc > %mpeg.f.tot) { goto done }
else {
set %mpeg.f.path $nofile(%mpeg.f.file)
did -a mpeg 1 $lower($remove($nopath(%mpeg.f.file),.mp3))
goto grrr
}
:done {
did -ra mpeg 10 tot: $+ $findfile(%mpeg.dir,*.mp3,0)
unset %mpeg.f.*
}
}