mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06: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.PreferenceHelper
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalTime
|
||||
|
||||
class AdvancedSettings : BasePreferenceFragment() {
|
||||
|
||||
@ -64,7 +66,7 @@ class AdvancedSettings : BasePreferenceFragment() {
|
||||
advancesBackup?.setOnPreferenceClickListener {
|
||||
BackupDialog {
|
||||
backupFile = it
|
||||
createBackupFile.launch("backup.json")
|
||||
createBackupFile.launch(getBackupFileName())
|
||||
}
|
||||
.show(childFragmentManager, null)
|
||||
true
|
||||
@ -93,4 +95,9 @@ class AdvancedSettings : BasePreferenceFragment() {
|
||||
}
|
||||
.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