From 0c878f81802d34f6ceddcee74ef459e962a358d9 Mon Sep 17 00:00:00 2001 From: gekeleda Date: Tue, 22 Apr 2025 16:53:39 +0200 Subject: [PATCH] add file contexts --- lib/ui/epub_viewer.dart | 3 ++- lib/ui/pdf_viewer.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ui/epub_viewer.dart b/lib/ui/epub_viewer.dart index 8832ed7..47adb78 100644 --- a/lib/ui/epub_viewer.dart +++ b/lib/ui/epub_viewer.dart @@ -33,7 +33,8 @@ Future launchEpubViewer( String? epubConfig = await dataBase.getBookState(fileName); if (openWithExternalApp) { - await OpenFile.open(path, linuxByProcess: true); + await OpenFile.open(path, + linuxByProcess: true, type: "application/epub+zip"); } else { try { VocsyEpub.setConfig( diff --git a/lib/ui/pdf_viewer.dart b/lib/ui/pdf_viewer.dart index fe0a6d2..0c6c8d0 100644 --- a/lib/ui/pdf_viewer.dart +++ b/lib/ui/pdf_viewer.dart @@ -29,7 +29,7 @@ Future launchPdfViewer( bool openWithExternalApp = ref.watch(openPdfWithExternalAppProvider); if (openWithExternalApp) { String path = await getFilePath(fileName); - await OpenFile.open(path, linuxByProcess: true); + await OpenFile.open(path, linuxByProcess: true, type: "application/pdf"); } else { Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) { return PdfView(