mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-14 09:46:01 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
28
lib/util/jellyfin_extension.dart
Normal file
28
lib/util/jellyfin_extension.dart
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue