mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Fix download issue caused by file name
This commit is contained in:
parent
2d74858935
commit
9257169bf3
@ -4,5 +4,5 @@ package com.github.libretube.extensions
|
|||||||
* Replace file name specific chars
|
* Replace file name specific chars
|
||||||
*/
|
*/
|
||||||
fun String.sanitize(): String {
|
fun String.sanitize(): String {
|
||||||
return this.replace("[^a-zA-Z0-9\\._]+", "_")
|
return this.replace("[^a-zA-Z0-9\\\\._]+".toRegex(), "_")
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ class DownloadDialog(
|
|||||||
if (binding.audioSpinner.size >= 1) binding.audioSpinner.setSelection(1)
|
if (binding.audioSpinner.size >= 1) binding.audioSpinner.setSelection(1)
|
||||||
|
|
||||||
binding.download.setOnClickListener {
|
binding.download.setOnClickListener {
|
||||||
if (binding.fileName.text.toString().length < 1) {
|
if (binding.fileName.text.toString().isEmpty()) {
|
||||||
Toast.makeText(context, R.string.invalid_filename, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, R.string.invalid_filename, Toast.LENGTH_SHORT).show()
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user