1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2025-07-17 11:16:23 +00:00

Added max_file_age to download only newer files.

This commit is contained in:
2018-03-15 06:48:37 +01:00
parent 6276651b84
commit 968ee831f0
5 changed files with 10 additions and 0 deletions

View File

@@ -326,6 +326,8 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI
prog!!.onMediaDownloadedEmpty()
} else if (m.downloaded) {
prog!!.onMediaAlreadyPresent(m)
} else if (IniSettings.max_file_age!=null && (System.currentTimeMillis() / 1000) - msg.date > IniSettings.max_file_age * 24 * 60 * 60) {
prog!!.onMediaTooOld()
} else {
try {
val result = m.download()