Merge pull request #3815 from yoguut/master

hotfix: import/export FormatList crash on init
This commit is contained in:
Bnyro 2023-05-22 18:47:47 +02:00 committed by GitHub
commit 1bc446f592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,12 +24,12 @@ class BackupRestoreSettings : BasePreferenceFragment() {
private val backupDateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd-HH:mm:ss") private val backupDateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd-HH:mm:ss")
private var backupFile = BackupFile() private var backupFile = BackupFile()
private var importFormat: ImportFormat = ImportFormat.NEWPIPE private var importFormat: ImportFormat = ImportFormat.NEWPIPE
private val importFormatList = listOf( private val importFormatList get() = listOf(
ImportFormat.NEWPIPE, ImportFormat.NEWPIPE,
ImportFormat.FREETUBE, ImportFormat.FREETUBE,
ImportFormat.YOUTUBECSV ImportFormat.YOUTUBECSV
).map { getString(it.value) } ).map { getString(it.value) }
private val exportFormatList = listOf( private val exportFormatList get() = listOf(
ImportFormat.NEWPIPE, ImportFormat.NEWPIPE,
ImportFormat.FREETUBE ImportFormat.FREETUBE
).map { getString(it.value) } ).map { getString(it.value) }
@ -110,10 +110,6 @@ class BackupRestoreSettings : BasePreferenceFragment() {
.show() .show()
} }
private fun exportFormatList(): List<String> {
return listOf(getString(R.string.import_format_newpipe), getString(R.string.import_format_freetube))
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.import_export_settings, rootKey) setPreferencesFromResource(R.xml.import_export_settings, rootKey)