// initialize it with known data..
// that should wipe out dupes.
- var filesize = this.query("SELECT filesize FROM Attachment WHERE id = %d".printf(
- int.parse(sid)));
+ var matches = this.execute("SELECT count(id) FROM Attachment WHERE id = %d".printf(
+ int.parse(sid)));
+ GLib.error("Got Matches :%s", matches);
+
+ if (matches=="0") {
+ GLib.error("Failed to find id :%s", sid);
+ return;
+ }
+
+
+ // initialize it with known data..
+ // that should wipe out dupes.
+ var filesize = this.execute("SELECT filesize FROM Attachment WHERE id = %d".printf(
+ int.parse(sid)));
+
+ if (filesize=="") {
+ GLib.debug("Ignoring record id (missing in database) :%s", sid);
+ return;
+ }
if (int.parse(filesize) < 1) {
GLib.debug("Could not get filesize from id :%s = %s", sid,filesize);
Posix.exit(0);
- var rc= this.mysql.query(str);
+ var rc= this.mysql.query(str);
if ( rc != 0 ) {
GLib.debug("ERROR %u: Query failed: %s\n", this.mysql.errno(), this.mysql.error());
}
if (!need_return) {
+ GLib.debug("got %s", got_row ? "=Nothing=" : ret);
return got_row ? "" : ret;
}
if (!got_row) {
continue;
}
-
+ var ds = next_file.get_display_name();
if (next_file.get_file_type() != FileType.DIRECTORY) {
- if (next_file.get_display_name()[0] == ',') {
+
+
+ if (ds[0] == ',') {
continue;
}
// other files to ignore?
-
- this.scan_file(basepath + subpath , next_file.get_display_name());
+ if (Regex.match_simple (".tgz$", ds)) {
+ continue;
+ }
+ this.scan_file(basepath + subpath , ds);
if(this.has_replaced) {
- this.report_state("After scanning %s/%s".printf(basepath + subpath , next_file.get_display_name()));
+ this.report_state("After scanning %s/%s".printf(basepath + subpath , ds));
}
continue;
}
- var ds = next_file.get_display_name();
+
// not really needed?? - we are storing attachments in a seperate location now...
if (ds[0] == '.') {
next_file = null;