feat(protocol): add FTP, FTPS and FTPES downloads (#1569)

This commit is contained in:
Silas Mariusz authored and GitHub committed 2026-10-30 17:01:46 +08:00
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);