fix(runtime): harden application service boundaries

This commit is contained in:
edde746
2026-07-24 03:46:46 +02:00
parent 658da37b48
commit e0bf66eea8
309 changed files with 32574 additions and 4369 deletions
+24 -1
View File
@@ -374,14 +374,37 @@ void main() {
expect(info.trickplayByWidth![320]!.width, 320);
});
test('falls back to first nested entry when source id not present as key', () {
test('does not attach another source trickplay when selected source is absent', () {
final info = jellyfinMediaSourceToMediaSourceInfo(
{'Id': 'unknown', 'MediaStreams': []},
trickplay: {
'src-1': {'160': _info(width: 160, height: 90, tw: 4, th: 4, count: 16, interval: 10000)},
},
);
expect(info.mediaSourceId, 'unknown');
expect(info.trickplayByWidth, isNull);
});
test('source-less media accepts exactly one nested trickplay candidate', () {
final info = jellyfinMediaSourceToMediaSourceInfo(
{'MediaStreams': []},
trickplay: {
'src-1': {'160': _info(width: 160, height: 90, tw: 4, th: 4, count: 16, interval: 10000)},
},
);
expect(info.trickplayByWidth?.keys.single, 160);
expect(info.trickplayByWidth?[160]?.interval, 10000);
});
test('source-less media rejects ambiguous nested trickplay candidates', () {
final info = jellyfinMediaSourceToMediaSourceInfo(
{'MediaStreams': []},
trickplay: {
'src-1': {'160': _info(width: 160, height: 90, tw: 4, th: 4, count: 16, interval: 10000)},
'src-2': {'320': _info(width: 320, height: 180, tw: 4, th: 4, count: 16, interval: 10000)},
},
);
expect(info.trickplayByWidth, isNull);
});
test('returns null trickplayByWidth when manifest missing', () {