Synchronize on demand

This commit is contained in:
M66B
2019-02-17 18:04:22 +00:00
parent c4208d1a61
commit 7b55d4e0fc
7 changed files with 137 additions and 51 deletions

View File

@@ -102,15 +102,8 @@ public class EntityOperation {
EntityFolder folder = db.folder().getFolder(fid);
int sync_days = folder.sync_days;
if (folder.last_sync != null) {
int ago_days = (int) ((new Date().getTime() - folder.last_sync) / (24 * 3600 * 1000L)) + 1;
if (ago_days > sync_days)
sync_days = ago_days;
}
JSONArray jargs = new JSONArray();
jargs.put(folder.initialize ? Math.min(EntityFolder.DEFAULT_INIT, folder.keep_days) : sync_days);
jargs.put(folder.getSyncDays());
jargs.put(folder.keep_days);
jargs.put(folder.download);