Fixed bug downlaod failed when file name too long.

This commit is contained in:
stonegate 2020-08-27 16:35:43 +08:00
parent fc4b8a275e
commit 5235e90e6a
1 changed files with 6 additions and 0 deletions

View File

@ -105,6 +105,9 @@ class AutoDownloader {
now.second.toString();
var fileName =
'${episode.title}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
if (fileName.length > 100) {
fileName = fileName.substring(fileName.length - 100);
}
var taskId = await FlutterDownloader.enqueue(
fileName: fileName,
url: episode.enclosureUrl,
@ -267,6 +270,9 @@ class DownloadState extends ChangeNotifier {
now.second.toString();
var fileName =
'${episode.title}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
if (fileName.length > 100) {
fileName = fileName.substring(fileName.length - 100);
}
var taskId = await FlutterDownloader.enqueue(
fileName: fileName,
url: episode.enclosureUrl,