fix(jellyfin): upload artwork as binary

This commit is contained in:
edde746
2026-06-07 13:32:07 +02:00
parent 38868e0078
commit 8efd8f1dc8
3 changed files with 5 additions and 6 deletions
+4 -4
View File
@@ -3016,15 +3016,15 @@ void main() {
expect(requests[1].queryParameters['imageUrl'], 'https://img.example/poster.jpg');
});
test('uploadItemImage sends base64 image body and image content type', () async {
test('uploadItemImage sends binary image body and image content type', () async {
Uri? capturedUri;
String? capturedBody;
List<int>? capturedBody;
Map<String, String>? capturedHeaders;
final client = JellyfinClient.forTesting(
connection: _conn(),
httpClient: MockClient((request) async {
capturedUri = request.url;
capturedBody = request.body;
capturedBody = request.bodyBytes;
capturedHeaders = request.headers;
return http.Response('', 204);
}),
@@ -3040,7 +3040,7 @@ void main() {
expect(success, isTrue);
expect(capturedUri!.path, '/Items/item-1/Images/Primary');
expect(capturedBody, base64Encode([0xff, 0xd8, 0xff, 0x00]));
expect(capturedBody, [0xff, 0xd8, 0xff, 0x00]);
expect(capturedHeaders!['Content-Type'] ?? capturedHeaders!['content-type'], 'image/jpeg');
});