mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 02:08:03 -06:00
Fix manifest issue, update download function and original file download support
This commit is contained in:
@@ -23,7 +23,7 @@ abstract class PaperlessDocumentsApi {
|
||||
Future<Iterable<int>> bulkAction(BulkAction action);
|
||||
Future<Uint8List> getPreview(int docId);
|
||||
String getThumbnailUrl(int docId);
|
||||
Future<Uint8List> download(DocumentModel document);
|
||||
Future<Uint8List> download(DocumentModel document, {bool original});
|
||||
Future<FieldSuggestions> findSuggestions(DocumentModel document);
|
||||
|
||||
Future<List<String>> autocomplete(String query, [int limit = 10]);
|
||||
|
||||
@@ -196,10 +196,14 @@ class PaperlessDocumentsApiImpl implements PaperlessDocumentsApi {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Uint8List> download(DocumentModel document) async {
|
||||
Future<Uint8List> download(
|
||||
DocumentModel document, {
|
||||
bool original = false,
|
||||
}) async {
|
||||
try {
|
||||
final response = await client.get(
|
||||
"/api/documents/${document.id}/download/",
|
||||
queryParameters: original ? {'original': true} : {},
|
||||
options: Options(responseType: ResponseType.bytes),
|
||||
);
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user