All pastes #1534288 Raw Edit

Someone

public text v1 · immutable
#1534288 ·published 2009-08-18 20:29 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,var %c = $1-)).title == $null) {
        msg $active missing title tag: %c
        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,var %c = $1-)).artist == $null) {
        msg $active missing artist tag: %c
        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,var %c = $1-)).artist == $null) && ($sound(%c).title == $null) {
        echo -sg msg $active missing BOTH tags: %c
        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
}