Import script now prevents double-import.
This commit is contained in:
parent
e910361aa0
commit
43755b90cc
|
@ -14,9 +14,9 @@
|
||||||
ini_set('memory_limit', '64M');
|
ini_set('memory_limit', '64M');
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
//header("Content-type: text/plain");
|
//header("Content-type: text/plain");
|
||||||
echo "===========================\n";
|
echo "===========================\n";
|
||||||
echo "\nStorageServer Import Script\n";
|
echo "StorageServer Import Script\n";
|
||||||
echo "===========================\n";
|
echo "===========================\n";
|
||||||
$start = intval(date('U'));
|
$start = intval(date('U'));
|
||||||
|
|
||||||
require_once('conf.php');
|
require_once('conf.php');
|
||||||
|
@ -83,10 +83,14 @@ while ($filename = fgets($stdin, 2048)) {
|
||||||
echo "Importing: $filename\n";
|
echo "Importing: $filename\n";
|
||||||
|
|
||||||
$md5sum = md5_file($filename);
|
$md5sum = md5_file($filename);
|
||||||
echo " * MD5: $md5sum\n";
|
//echo " * MD5: $md5sum\n";
|
||||||
|
|
||||||
// Look up md5sum in database
|
// Look up md5sum in database
|
||||||
|
$file = StoredFile::RecallByMd5($md5sum);
|
||||||
|
if ($file) {
|
||||||
|
echo " * File already exists in the database.\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$mdata = camp_get_audio_metadata($filename, $testonly);
|
$mdata = camp_get_audio_metadata($filename, $testonly);
|
||||||
if (PEAR::isError($mdata)) {
|
if (PEAR::isError($mdata)) {
|
||||||
import_err($mdata);
|
import_err($mdata);
|
||||||
|
|
Loading…
Reference in New Issue