leoding86 / pixiv-omina

Pixiv Omina is a software for downloading artworks and comics from Pixiv and Pixiv Comic
Mozilla Public License 2.0
280 stars 25 forks source link

First download from extension button not added #93

Open chaotic-dev opened 2 years ago

chaotic-dev commented 2 years ago

Clicking the Omina button on the extension launches the application but doesn't add the download until clicked a second time

Expected behavior: Omina should be launched and the post should be added according to download settings

Pixiv Toolkit Version: v5.5.3 Pixiv Omina Version: 0.9.1 (16ae0bc388dd55fcaaa791927b550d570dcc1d37) Operating System: Pop!_OS 21.10 (Issue should be OS independent as far as I can tell) Browser: Mozilla Firefox for Ubuntu 99.0 (64-bit)

sakkamade commented 2 years ago

Sorry, no idea what #94 PR really does, but I just tried and button works fine for me even without that patch.

I only had to add a new XDG mime scheme, like:

$ xdg-mime default *desktop-filename*.desktop x-scheme-handler/pixiv-omina

Or manually edit mimeapps file:

~/.config/mimeapps.list
---
...
[Default Applications]
...
x-scheme-handler/pixiv-omina=*desktop-filename*.desktop

Oh, and I have a .desktop file that executes Pixiv Omina Appimage and passes arguments to it with something like %U:

~/.local/share/applications/pixiv-omina.desktop
---
...
Exec=/path/to/appimage %U
...

But I guess any of the following would work %f, %u, %F, %U.

chaotic-dev commented 2 years ago

I've set up the xdg-mime and created a .desktop entry as well. My issue was that if Omina isn't currently running, the first time you click download it will only open the app but won't download the file. It looks like the arguments aren't being read during the first launch.

sakkamade commented 2 years ago

Ah, you are completely right.