All pastes #1534006 Raw Edit

Anonymous

public text v1 · immutable
#1534006 ·published 2009-08-18 16:23 UTC
rendered paste body
alias checktags {
  if ($1 == title) {
    var %a = $findfile(%musicdir,*.mp3,0)
    var %b = 0
    while (%a > 0) {
      if ($sound($findfile(%musicdir,*.mp3,%a)).title == $null) {
        echo -sg $findfile(%musicdir,*.mp3,%a,msg $active missing title tag: $1-)
        inc %b
      }
      dec %a
    }
    msg $active tag checking is finished. total missing title tags: %b | Halt
  }
  if ($1 == artist) {
    var %a = $findfile(%musicdir,*.mp3,0)
    var %b = 0
    while (%a > 0) {
      if ($sound($findfile(%musicdir,*.mp3,%a)).artist == $null) {
        echo -sg $findfile(%musicdir,*.mp3,%a,msg $active missing artist tag: $1-)
        inc %b
      }
      dec %a
    }
    msg $active tag checking is finished. total missing artist tags: %b | Halt
  }
  if ($1 == both) {
    var %a = $findfile(%musicdir,*.mp3,0)
    var %b = 0
    while (%a > 0) {
      if ($sound($findfile(%musicdir,*.mp3,%a)).artist == $null) && ($sound($findfile(%musicdir,*.mp3,%a)).title == $null) {
        echo -sg $findfile(%musicdir,*.mp3,%a,msg $active missing BOTH tags: $1-)
        inc %b
      }
      dec %a
    }
    msg $active tag checking is finished. total missing BOTH tags: %b | Halt
  }
  msg $active you have to use either /checktags title, artist, or both
}