mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 05:43:41 +00:00
Merge remote-tracking branch 'origin/main' into codex/fix-bt-file-selection
# Conflicts: # ui/flutter/test/features/tasks/domain/task_record_test.dart
This commit is contained in:
commit
a83e3a2b84
272 files changed
+17212
-1065
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:gopeed/api/model/task.dart' as api;
|
||||
import 'package:gopeed/core/icons/gopeed_icons.dart';
|
||||
import 'package:gopeed/features/tasks/domain/task_record.dart';
|
||||
|
||||
void main() {
|
||||
@@ -41,4 +42,19 @@ void main() {
|
||||
expect(record.files.length, 3);
|
||||
expect(record.totalBytes, 60);
|
||||
});
|
||||
|
||||
test('file names preserve hash and question mark characters for type detection', () {
|
||||
expect(
|
||||
taskFileTypeIcon('Slow English Podcast #2 _ Eating, Talking, and Learning Natural English.mp4'),
|
||||
GopeedIcons.fileVideo,
|
||||
);
|
||||
expect(taskFileTypeIcon('What is this? #2.MP4'), GopeedIcons.fileVideo);
|
||||
expect(taskFileTypeIcon('Episode #2.mp3'), GopeedIcons.fileAudio);
|
||||
});
|
||||
|
||||
test('URL fallback ignores query and fragment when detecting file type', () {
|
||||
expect(taskFileTypeIcon('https://example.com/video.mp4?token=abc#part'), GopeedIcons.fileVideo);
|
||||
expect(taskFileTypeIcon('https://example.com/download?name=video.mp4'), GopeedIcons.file);
|
||||
expect(taskFileTypeIcon('Playlist #2.mp4', isFolder: true), GopeedIcons.folder);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user