1
0
mirror of https://github.com/stonega/tsacdop synced 2025-02-17 20:10:37 +01:00

Fix bug, '/' in episode title download fail.

This commit is contained in:
stonega 2021-02-06 02:20:49 +08:00
parent b7047f29fc
commit 35d749564c

View File

@ -111,7 +111,7 @@ class AutoDownloader {
now.day.toString() +
now.second.toString();
var fileName =
'${episode.title}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
'${episode.title.replaceAll('/', '')}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
if (fileName.length > 100) {
fileName = fileName.substring(fileName.length - 100);
}
@ -161,6 +161,7 @@ class DownloadState extends ChangeNotifier {
taskId: task.taskId, shouldDeleteContent: true);
} else {
if (task.status == DownloadTaskStatus.complete) {
final filname = task.filename.replaceAll('/', '');
var exist =
await File(path.join(task.savedDir, task.filename)).exists();
if (!exist) {
@ -283,7 +284,7 @@ class DownloadState extends ChangeNotifier {
now.day.toString() +
now.second.toString();
var fileName =
'${episode.title}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
'${episode.title.replaceAll('/', '')}$datePlus.${episode.enclosureUrl.split('/').last.split('.').last}';
if (fileName.length > 100) {
fileName = fileName.substring(fileName.length - 100);
}