commit 19/05/2025
This commit is contained in:
@@ -21,7 +21,6 @@ public class PhotoCleaner {
|
||||
public PhotoCleaner(int days){
|
||||
this.days = days;
|
||||
this.started = new boolean[]{false};
|
||||
System.out.println("PhotoCleaner created, days: "+days);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +30,6 @@ public class PhotoCleaner {
|
||||
public void Start(){
|
||||
Thread thread = new Thread(() -> {
|
||||
started[0] = true;
|
||||
System.out.println("PhotoCleaner started");
|
||||
while (started[0]) {
|
||||
try {
|
||||
System.out.println("Rechecking Database for older photos...");
|
||||
@@ -42,7 +40,6 @@ public class PhotoCleaner {
|
||||
Thread sqldelete = new Thread(()->{
|
||||
Sqlite sql = new Sqlite();
|
||||
PhotoReviewClass[] prcs = sql.GetAll();
|
||||
System.out.println("Database contains "+prcs.length+" PhotoReviewClass");
|
||||
for (PhotoReviewClass prc : prcs) {
|
||||
if (!started[0]) break;
|
||||
if (prc != null && prc.getDateTime() != null) {
|
||||
@@ -55,7 +52,7 @@ public class PhotoCleaner {
|
||||
SomeCodes.Delete(prc.compressedcrop());
|
||||
SomeCodes.Delete(prc.thumbnails());
|
||||
sql.Delete(prc);
|
||||
System.out.println("Deleted PhotoReviewClass: " + prc.getDateTime() + " " + prc.getPrefix());
|
||||
Logger.info("Deleted PhotoReviewClass: " + prc.getDateTime() + " " + prc.getPrefix());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,10 +100,8 @@ public class PhotoCleaner {
|
||||
this.now = LocalDateTime.now();
|
||||
}
|
||||
public void run(){
|
||||
System.out.println("DiskDeleter started, path: "+path);
|
||||
Path[] ppp = SomeCodes.GetFilesInDirectory(path);
|
||||
if (ppp != null){
|
||||
System.out.println("DiskDeleter found "+ppp.length+" files in path: "+path);
|
||||
for(Path p : ppp){
|
||||
if (!started[0]) break;
|
||||
LocalDateTime ldt = SomeCodes.GetCreationTime(p);
|
||||
|
||||
Reference in New Issue
Block a user