mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 04:43:41 +00:00
feat(protocol): add FTP, FTPS and FTPES downloads (#1569)
This commit is contained in:
1 parent
e0951de270
commit
c0b70d319d
54 files changed
+3850
-38
No files matched your search
@@ -4,10 +4,10 @@ import 'package:gopeed/core/icons/gopeed_icons.dart';
|
||||
import 'package:gopeed/features/tasks/domain/task_record.dart';
|
||||
|
||||
void main() {
|
||||
api.Task buildTask(List<int> selection, int size, {String? doneAt}) => api.Task.fromJson({
|
||||
api.Task buildTask(List<int> selection, int size, {String? doneAt, String protocol = 'bt'}) => api.Task.fromJson({
|
||||
'id': 'bt-selection',
|
||||
'name': 'bundle',
|
||||
'protocol': 'bt',
|
||||
'protocol': protocol,
|
||||
'status': 'running',
|
||||
'uploading': false,
|
||||
'createdAt': '2026-01-01T00:00:00Z',
|
||||
@@ -38,6 +38,13 @@ void main() {
|
||||
expect(record.progress, 0.25);
|
||||
});
|
||||
|
||||
test('tasks with the ftp protocol decode', () {
|
||||
final task = buildTask([], 60, protocol: 'ftp');
|
||||
expect(task.protocol, api.Protocol.ftp);
|
||||
final record = TaskRecord.fromApi(task);
|
||||
expect(record.protocol, api.Protocol.ftp);
|
||||
});
|
||||
|
||||
test('empty selection preserves default all files', () {
|
||||
final record = TaskRecord.fromApi(buildTask([], 60));
|
||||
expect(record.files.length, 3);
|
||||
|
||||
Reference in new issue
Block a user