src/strip.vala
authorAlan Knowles <alan@roojs.com>
Thu, 24 May 2018 09:13:03 +0000 (17:13 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 May 2018 09:13:03 +0000 (17:13 +0800)
src/strip.vala.c

src/strip.vala

index 9fc2d02..62ba249 100644 (file)
@@ -889,6 +889,25 @@ public class Strip : GLib.Object {
                                return;
                        }
                 
+               var newest = new  DateTime.now_local();
+                       newest = newest.add_months(-1 * StripApplication.opt_age_newest);
+                       
+                       GLib.debug("Checking directory %s is newer than min: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );                                   
+                       
+                       if (year > newest.get_year()) {
+                               GLib.debug("Skip directory %s is newer than min year: %d", subpath, newest.get_year());
+                               return;
+                       }
+                       if (year == newest.get_year() &&  month < newest.get_month()) {
+                               GLib.debug("Skip directory %s is newer than min year: %d/%d", subpath, newest.get_year() , newest.get_month() );
+                               return;
+                       }
+               if (year == newest.get_year() &&  month == newest.get_month() && day < newest.get_day_of_month()) {
+                               GLib.debug("Skip directory %s is newer than min year: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );          
+                               return;
+                       }
+               
+               
                
         }