All pastes #363093 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-19 05:52 UTC
rendered paste body
alias albums {
  var %path d:\ $+ $1- $+ \
  if ($isid) {
    if $isdir(%path) && (!$2) {
      return $finddir(%path,*,0,1)
    }
    elseif ($2 isnum) {
      var %temp $finddir(%path,*,$2)
      if ($exists(%temp $+ \ $+ Thumbs.db)) {
        var %tracks $calc($findfile(%temp,*,0) - 1)
      }
      else {
        var %tracks $findfile(%temp,*,0)
      }
      var %temp2 $deltok(%temp,1-3,92)
      var %albumname $delyear(%temp2)
      var %year $gettok($gettok(%temp2,1,41),1,40)
      var %discs $iif($finddir($finddir(%path,*,$2),*,0),$ifmatch CDs $+ $chr(44),$null)
      return %albumname $+($chr(40),%year,$chr(44),$chr(32),%discs,$chr(32),%tracks tracks,$chr(41))
    }
  }
}