mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Merge pull request #6337 from Bnyro/master
fix: download fails due to filename length
This commit is contained in:
commit
0c39a25a4c
@ -149,7 +149,7 @@ class DownloadDialog : DialogFragment() {
|
|||||||
return@onDownloadConfirm
|
return@onDownloadConfirm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileName.length > MAX_FILE_NAME_LENGTH - 20) { // reserve 20 chars for quality and extension
|
if (fileName.toByteArray().size > MAX_FILE_NAME_BYTES - 32) { // reserve 32 bytes for quality and extension
|
||||||
Toast.makeText(context, R.string.filename_too_long, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, R.string.filename_too_long, Toast.LENGTH_SHORT).show()
|
||||||
return@onDownloadConfirm
|
return@onDownloadConfirm
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ class DownloadDialog : DialogFragment() {
|
|||||||
/**
|
/**
|
||||||
* Max file name length at Android systems
|
* Max file name length at Android systems
|
||||||
*/
|
*/
|
||||||
private const val MAX_FILE_NAME_LENGTH = 255
|
private const val MAX_FILE_NAME_BYTES = 255
|
||||||
|
|
||||||
private const val VIDEO_DOWNLOAD_QUALITY = "video_download_quality"
|
private const val VIDEO_DOWNLOAD_QUALITY = "video_download_quality"
|
||||||
private const val VIDEO_DOWNLOAD_FORMAT = "video_download_format"
|
private const val VIDEO_DOWNLOAD_FORMAT = "video_download_format"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user