Limit download directory length. Close #311

This commit is contained in:
2025-04-01 15:49:22 +08:00
parent daa6e8ce18
commit 05fcb23a4d
3 changed files with 18 additions and 12 deletions

View File

@@ -461,6 +461,10 @@ class LocalManager with ChangeNotifier {
if (comic != null) {
return Directory(FilePath.join(path, comic.directory));
}
const comicDirectoryMaxLength = 128;
if (name.length > comicDirectoryMaxLength) {
name = name.substring(0, comicDirectoryMaxLength);
}
var dir = findValidDirectoryName(path, name);
return Directory(FilePath.join(path, dir)).create().then((value) => value);
}