From: Alan Knowles Date: Thu, 24 May 2018 09:01:23 +0000 (+0800) Subject: src/strip.vala X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=17adb7cd085c07a9e015b185da787229fca45d7b;p=app.mailtrimmer src/strip.vala --- diff --git a/src/strip.vala b/src/strip.vala index 2820a0f..ed7fee2 100644 --- a/src/strip.vala +++ b/src/strip.vala @@ -868,18 +868,22 @@ public class Strip : GLib.Object { // determine if path is to old to scan.. if (subpath.length > 0 && StripApplication.opt_scan_mailfort) { var year = int.parse(subpath.substring(1,4)); // "/2000" - var month = subpath.length > 5 ? int.parse(subpath.substring(6,2)) : 0; // "/2000/12" - var day = subpath.length > 8 ? int.parse(subpath.substring(9,2)) : 0; // "/2000/12/01" + var month = subpath.length > 5 ? int.parse(subpath.substring(6,2)) : 999; // "/2000/12" + var day = subpath.length > 8 ? int.parse(subpath.substring(9,2)) : 999; // "/2000/12/01" var oldest = new DateTime.now_local(); oldest = oldest.add_months(-1 * StripApplication.opt_age_oldest); if (year < oldest.get_year()) { + GLib.debug("Skip directory %s is older than min year: %d", subpath, oldest.get_year()); return; } if (year == oldest.get_year() && month < oldest.get_month()) { + GLib.debug("Skip directory %s is older than min year: %d/%d", subpath, oldest.get_year() , oldest.get_month() ); + return; + } + if (year == oldest.get_year() && month == oldest.get_month() && day < oldest.get_day()) { return; } -