Fixed bug downlaod failed when file name too long.
This commit is contained in:
parent
fc4b8a275e
commit
5235e90e6a
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue