Fix viewing LRF files not working. Fixes #1970391 [LRF books cannot be viewed](https://bugs.launchpad.net/calibre/+bug/1970391)

This commit is contained in:
Kovid Goyal 2022-04-26 17:15:12 +05:30
parent fde3f7bbb0
commit 3a83e75401
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -168,12 +168,13 @@ class ViewAction(InterfaceAction):
if name is not None: if name is not None:
args.append(name) args.append(name)
if open_at is not None: if viewer != 'lrfviewer':
args.append('--open-at=' + open_at) if open_at is not None:
if calibre_book_data is not None: args.append('--open-at=' + open_at)
with PersistentTemporaryFile('.json') as ptf: if calibre_book_data is not None:
ptf.write(as_bytes(json.dumps(calibre_book_data))) with PersistentTemporaryFile('.json') as ptf:
args.append('--internal-book-data=' + ptf.name) ptf.write(as_bytes(json.dumps(calibre_book_data)))
args.append('--internal-book-data=' + ptf.name)
self.gui.job_manager.launch_gui_app(viewer, self.gui.job_manager.launch_gui_app(viewer,
kwargs=dict(args=args)) kwargs=dict(args=args))
else: else: