check_still_records

Versions
mediamosa-21 – mediamosa-174
check_still_records()

Code

integrity_check/integrity_check.php, line 116

<?php
function check_still_records() {
  $missing_stills = array();
  $skip_files = array();

  $resource = db_query("SELECT mediafile_id AS still_id FROM {mediafile} WHERE is_still = 'TRUE'");
  while ($still = db_fetch_array($resource)) {
    // check if file exists
    $file = SAN_NAS_BASE_PATH. DS . STILL_LOCATION . DS . $still['still_id']{0} . DS . $still['still_id'];
    if (!file_exists($file)) {
      $missing_stills[] = $still['still_id'];
    }
    else {
      $skip_files[] = $still['still_id'];
    }
  }
  log_message('stillrecord', $missing_stills);
  return $skip_files;
}
?>