mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08:00
28 lines
687 B
Dart
28 lines
687 B
Dart
import 'dart:convert';
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:chopper/chopper.dart';
|
|
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
|
|
|
|
extension JellyApiExtension on JellyfinOpenApi {
|
|
Future<Response<dynamic>?> itemIdImagesImageTypePost(
|
|
ImageType type,
|
|
String itemId,
|
|
Uint8List data,
|
|
) async {
|
|
final client = this.client;
|
|
final uri = Uri.parse('/Items/$itemId/Images/${type.value}');
|
|
final response = await client.send(
|
|
Request(
|
|
'POST',
|
|
uri,
|
|
this.client.baseUrl,
|
|
body: base64Encode(data),
|
|
headers: {
|
|
'Content-Type': 'image/*',
|
|
},
|
|
),
|
|
);
|
|
return response;
|
|
}
|
|
}
|