|
|
@ -147,7 +147,8 @@ public class WorkerCleanup extends Worker {
|
|
|
|
Log.i("Cleanup attachment files");
|
|
|
|
Log.i("Cleanup attachment files");
|
|
|
|
File[] attachments = new File(context.getFilesDir(), "attachments").listFiles();
|
|
|
|
File[] attachments = new File(context.getFilesDir(), "attachments").listFiles();
|
|
|
|
if (attachments != null)
|
|
|
|
if (attachments != null)
|
|
|
|
for (File file : attachments) {
|
|
|
|
for (File file : attachments)
|
|
|
|
|
|
|
|
if (manual || file.lastModified() + KEEP_FILES_DURATION < now) {
|
|
|
|
long id = Long.parseLong(file.getName().split("\\.")[0]);
|
|
|
|
long id = Long.parseLong(file.getName().split("\\.")[0]);
|
|
|
|
EntityAttachment attachment = db.attachment().getAttachment(id);
|
|
|
|
EntityAttachment attachment = db.attachment().getAttachment(id);
|
|
|
|
if (attachment == null || !attachment.available) {
|
|
|
|
if (attachment == null || !attachment.available) {
|
|
|
|