// initialize it with known data..
// that should wipe out dupes.
- var matches = this.execute("SELECT id FROM Attachment WHERE id = %d".printf(
+ var matches = this.query("SELECT count(id) FROM Attachment WHERE id = %d".printf(
int.parse(sid)));
- if (matches == "") {
+ if (matches == "0") {
// our old mailfort code deleted the crap out of old records...
// if this occurs we will need to create the record again..
this.fix_deleted_attachment_db(int.parse(sid),attachment);
// initialize it with known data..
// that should wipe out dupes.
- var filesize = this.execute("SELECT filesize FROM Attachment WHERE id = %d".printf(
+ var filesize = this.query("SELECT filesize FROM Attachment WHERE id = %d".printf(
int.parse(sid)));
if (filesize=="") {
var filename = attachment.get_header("X-strip-content-name");
var file_path = attachment.get_header("X-strip-path");
var fn = StripApplication.opt_target_path + "/" + file_path;
+
+
+ if (!FileUtils.test (fn, FileTest.EXISTS)) {
+ GLib.debug("SKIP -- file does not exist");
+ return;
+ }
+
var chksum = this.md5_file(fn);
var mime_type = attachment.get_header("X-strip-content-type");
,GLib.FileQueryInfoFlags.NONE,null);
var file_size = (int) fileinfo.get_size();
- if (!FileUtils.test (fn, FileTest.EXISTS)) {
- GLib.debug("SKIP -- file does not exist");
- }
this.real_query(-1, """