mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 21:33:41 +00:00
Merge PR #1512 into 2.0.0-beta.2
This commit is contained in:
commit
91bea83692
29 files changed
+1970
-15
No files matched your search
@@ -299,8 +299,9 @@ TaskAssetType _assetType(String name, {required bool isFolder, required api_task
|
||||
}
|
||||
|
||||
String _fileExtension(String name) {
|
||||
final pathWithoutQuery = name.split(RegExp(r'[?#]')).first;
|
||||
final extension = path.extension(pathWithoutQuery).replaceFirst('.', '').toLowerCase();
|
||||
final uri = Uri.tryParse(name);
|
||||
final filePath = uri != null && uri.hasScheme && uri.hasAuthority ? uri.path : name;
|
||||
final extension = path.extension(filePath).replaceFirst('.', '').toLowerCase();
|
||||
return extension.length <= 10 ? extension : '';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user