mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-07 18:10:31 +05:30
better backup title
This commit is contained in:
parent
8046ba97db
commit
7704b8f40b
@ -17,6 +17,8 @@ import com.github.libretube.util.BackupHelper
|
|||||||
import com.github.libretube.util.ImageHelper
|
import com.github.libretube.util.ImageHelper
|
||||||
import com.github.libretube.util.PreferenceHelper
|
import com.github.libretube.util.PreferenceHelper
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.LocalTime
|
||||||
|
|
||||||
class AdvancedSettings : BasePreferenceFragment() {
|
class AdvancedSettings : BasePreferenceFragment() {
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ class AdvancedSettings : BasePreferenceFragment() {
|
|||||||
advancesBackup?.setOnPreferenceClickListener {
|
advancesBackup?.setOnPreferenceClickListener {
|
||||||
BackupDialog {
|
BackupDialog {
|
||||||
backupFile = it
|
backupFile = it
|
||||||
createBackupFile.launch("backup.json")
|
createBackupFile.launch(getBackupFileName())
|
||||||
}
|
}
|
||||||
.show(childFragmentManager, null)
|
.show(childFragmentManager, null)
|
||||||
true
|
true
|
||||||
@ -93,4 +95,9 @@ class AdvancedSettings : BasePreferenceFragment() {
|
|||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getBackupFileName(): String {
|
||||||
|
val time = LocalTime.now().toString().split(".").firstOrNull()
|
||||||
|
return "libretube-backup-${LocalDate.now()}-$time.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user