mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 04:07:56 -06:00
update viewer impl
This commit is contained in:
@@ -28,7 +28,7 @@ abstract class PaperlessDocumentsApi {
|
||||
String getThumbnailUrl(int docId);
|
||||
Future<Uint8List> downloadDocument(int id, {bool original});
|
||||
Future<void> downloadToFile(
|
||||
DocumentModel document,
|
||||
int id,
|
||||
String localFilePath, {
|
||||
bool original = false,
|
||||
void Function(double progress)? onProgressChanged,
|
||||
|
||||
@@ -223,14 +223,14 @@ class PaperlessDocumentsApiImpl implements PaperlessDocumentsApi {
|
||||
|
||||
@override
|
||||
Future<void> downloadToFile(
|
||||
DocumentModel document,
|
||||
int id,
|
||||
String localFilePath, {
|
||||
bool original = false,
|
||||
void Function(double)? onProgressChanged,
|
||||
}) async {
|
||||
try {
|
||||
final response = await client.download(
|
||||
"/api/documents/${document.id}/download/",
|
||||
"/api/documents/$id/download/",
|
||||
localFilePath,
|
||||
onReceiveProgress: (count, total) =>
|
||||
onProgressChanged?.call(count / total),
|
||||
|
||||
Reference in New Issue
Block a user