fix: retry live tv tune, clamp timeline duration

This commit is contained in:
edde746
2026-04-22 08:45:02 +02:00
parent 06b3c9645c
commit b2cd0c2c37
5 changed files with 53 additions and 7 deletions
+24
View File
@@ -84,4 +84,28 @@ void main() {
expect(e.toString(), 'PlexHttpException(cancelled: halt)');
});
});
group('PlexHttpException.isTransient', () {
PlexHttpException ex(PlexHttpErrorType t) => PlexHttpException(type: t);
test('connectionTimeout is transient', () {
expect(ex(PlexHttpErrorType.connectionTimeout).isTransient, isTrue);
});
test('receiveTimeout is transient', () {
expect(ex(PlexHttpErrorType.receiveTimeout).isTransient, isTrue);
});
test('connectionError is transient', () {
expect(ex(PlexHttpErrorType.connectionError).isTransient, isTrue);
});
test('cancelled is NOT transient (user-driven abort)', () {
expect(ex(PlexHttpErrorType.cancelled).isTransient, isFalse);
});
test('unknown is NOT transient', () {
expect(ex(PlexHttpErrorType.unknown).isTransient, isFalse);
});
});
}