edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.81k stars 154 forks source link

[Linux package] Commit ae59fb9 makes all normal ZIP files use the `x-office-document` icon #1468

Closed ghost closed 3 years ago

ghost commented 3 years ago

Commit ae59fb9 adds the MIME type application/zip to package.json, but this has an unintended effect which makes all normal ZIP files use the x-office-document icon.

To reproduce this bug, install Thorium 1.7.0 and browse a directory with normal ZIP files using KDE Dolphin or any file manager.

I guess the reason is that due to electron-builder's limitations, on Linux the x-office-document icon is used for all file associations in package.json.

In addition, according to that webpage, there is no way to specify another icon for Linux, and we need to file an issue (feature request) to electron-builder if we want that feature.

ghost commented 3 years ago

Icons for PDF and EPUB files are also affected.

KDE's Breeze and Oxygen themes have separate icons for PDF and EPUB files, and you can tell the file type by the icon.

However, the installed XML file overrides the icon, so PDF and EPUB files both use the same x-office-document icon, which makes it hard to distinguish the file type if you only look at the icon.


Is there any plan to submit the MIME types to upstream shared-mime-info?

You can use the comment element in the XML file to give a human-readable textual description of the MIME type.

The upstream shared-mime-info XML is also more detailed and has better detection for EPUB files using file magic.

danielweck commented 3 years ago

Hello! Mea culpa: I added the .zip file extension in the Electron Builder configuration, as ZIP files are officially supported by Thorium as a valid container file type for DAISY3 Digital Talking Books. The benefit is that this enables the "open with ..." and double-click use case from file explorer / finder, but this was in fact a short-sighted move on my part: when Thorium is installed on Windows, Mac and Linux, the app declares itself as a handler for ZIP files, and it "jumps" the queue ahead of other existing handlers (typically, (de)compression apps!). As far as I know Electron Builder doesn't allow us to easily modify this default installation behaviour. I will revert the file extension association, but of course Thorium's UI will continue to accept ZIP files via the file chooser / selector, and drag + drop. Sorry for the inconvenience caused. Daniel

danielweck commented 3 years ago

Fixed via https://github.com/edrlab/thorium-reader/commit/5ccb8f1cbc438379ea3a15581cf69cc5ab2d9908