SlimChances wrote: 
> The code(Mr.Cs) will work for indivdual Albums but using it to test an
> entire directory produces output with file names but not parent
> directories. So for example running the code within my Blues directory
> it found 10 songs with this error message "WARNING, cannot check MD5
> signature since it was unset in the STREAMINFO " but identified only the
> file name not the folder they belonged to. It was easy to find the
> particular album in this case as all 10 songs belonged to one album and
> I used Nemo's search function (using Cinnamon DE) to identify the folder
> name. If the output of errors was of a much larger size it would be
> tedious finding the parent folders.
> However this gives me another way of testing my FLACs and I am most
> grateful.

You could get the directory names incorporated into the error log with
something like this:

testlflacs.sh

Code:
--------------------
    
  #!/bin/sh
  DATE=$(date)
  
  MUSICDIR="$1"
  
  if [ -z "$MUSICDIR" ]; then
        MUSICDIR='/mnt/Media/Music'
  fi
  
  # Remove any trailing slash from MUSICDIR
  MUSICDIR=${MUSICDIR%/}
  
  # Canonicalize
  MUSICDIR=$(readlink -f "$MUSICDIR")
  
  ERROR_LOG="${MUSICDIR}/flac_errors.log"
  
  echo "Recursively testing flacs in $(readlink -f "${MUSICDIR}")"
  echo "Flac decoding errors logged to ${ERROR_LOG}"
  
  echo "Flac test of $(readlink -f "${MUSICDIR}") started at ${DATE}" 
>"$ERROR_LOG"
  echo "Errors were found in the following flac files:" >>"$ERROR_LOG"
  
  find "${MUSICDIR}/" -name '*.flac' -type f -not -exec /usr/bin/flac -t 
--totally-silent '{}' \; -and -print >>"$ERROR_LOG" 
  
  DATE=$(date)
  echo "Flac tests of ${MUSICDIR} compleated at ${DATE}" >>"$ERROR_LOG"
  
  echo -e 'Done!\n\n'
  
  cat "$ERROR_LOG"
  
--------------------


------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=97923

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to