From 49d29ae675107040f04d9fb46c4f1b1aebcc44b9 Mon Sep 17 00:00:00 2001 From: Mac135135 Date: Sat, 28 Sep 2024 19:20:25 +0300 Subject: [PATCH] Added an periodical backup to the telegram bot --- .../main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt | 1 + .../kotatsu/settings/backup/PeriodicalBackupSettingsFragment.kt | 1 + .../koitharu/kotatsu/settings/backup/PeriodicalBackupWorker.kt | 1 - app/src/main/res/xml/pref_backup_periodic.xml | 1 - 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt index 10fd980f6..84a7c2db3 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt @@ -43,6 +43,7 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) { private val connectivityManager = context.connectivityManager private val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) + var telegramChatId: String? get() = preferences.getString("telegram_chat_id", null) set(value) { diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupSettingsFragment.kt b/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupSettingsFragment.kt index 164f76312..17ded15be 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupSettingsFragment.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupSettingsFragment.kt @@ -194,3 +194,4 @@ class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodi return resolveFile(context)?.path ?: toString() } } + diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupWorker.kt b/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupWorker.kt index 33a352b4f..e585b2f03 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupWorker.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/settings/backup/PeriodicalBackupWorker.kt @@ -151,4 +151,3 @@ class PeriodicalBackupWorker @AssistedInject constructor( const val DATA_TIMESTAMP = "ts" } } - diff --git a/app/src/main/res/xml/pref_backup_periodic.xml b/app/src/main/res/xml/pref_backup_periodic.xml index db089196b..e6664e262 100644 --- a/app/src/main/res/xml/pref_backup_periodic.xml +++ b/app/src/main/res/xml/pref_backup_periodic.xml @@ -43,5 +43,4 @@ android:defaultValue="" android:summary="Enter the chat ID where backups should be sent" /> -