-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
z-library-desktop: init at 3.0.0 #399610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
z-library-desktop: init at 3.0.0 #399610
Conversation
5ee9ffb to
1cb8954
Compare
|
|
|
Didn't even know about this. Thank your packaging this. During testing, I couldn't download books:
The FileChooser is definitely available, so I assume this is somehow due to the testing environment, but I thought I'd mention it, as I don't remember having that issue with other graphical applications in nixpkgs-review. |
|
Okay, narrowed it down a bit. I forgot to mention that the original test was in a Niri session. Just installed it in an Archlinux distrobox via the AUR and yep, FileChooser works as expected. In GNOME it works with both this derivation, started from the nixpkgs-review environment, and with the distrobox/Arch package. |
1cb8954 to
a7df3ff
Compare
a7df3ff to
1f18960
Compare
|
Updated: 2.4.1 -> 2.4.2. Added an update script. The scripts find the latest URL of Z-Library (which is always changing) by reading from a Wikipedia article. It also makes an HTTP request to Wayback Machine to get an archive link. |
1f18960 to
b564101
Compare
|
Updated: 2.4.2 -> 2.4.3. Changed the package name from |
59d5b19 to
f995c3c
Compare
|
Use The original software is distributed with Electron 34.1.1, but it seems to run perfectly with Electron 37 (current version of |
f995c3c to
fb1792d
Compare
fb1792d to
b28b381
Compare
b28b381 to
a7252f5
Compare
|
Updated to 3.0.0. Also added something specifically for darwin, but I still cannot test it because |
marcin-serwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds and runs on x86_64-linux.
011b238 to
32819b3
Compare
|
Tested that it is usable on darwin too now. |
|
32819b3 to
e4f95cd
Compare
|
Updated in accordance with #422938. |
| @@ -0,0 +1,79 @@ | |||
| #!/usr/bin/env nix-shell | |||
| #!nix-shell -i ruby -p ruby ruby.gems.nokogiri | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use shell to be similar to the standard update scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nokogiri is a very nice API for HTML scraping. In theory it can be written in a shell script, but it will be lengthy and hard to write and maintain.
| wikipedia = Nokogiri::HTML Net::HTTP.get URI 'https://en.wikipedia.org/wiki/Z-Library' | ||
| url = wikipedia.at_css('.infobox th.infobox-label:contains("URL") + td.infobox-data a[href^="https://"]')&.[] 'href' | ||
| abort 'Could not find Z-Library URL on Wikipedia page.' unless url | ||
| abort "Could not update homepage #{current_homepage} -> #{url}" unless nix.sub! current_homepage, url | ||
| log "Z-Library URL: #{url}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we parse the wikipedia page here? Can we just hardcode the website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is constantly changing. Wikipedia is quite reliable in giving the latest working URL.
| finish 'Version is up to date.' if version == current_version | ||
| abort "Could not update version: #{current_version} -> #{version}" unless nix.sub! current_version, version | ||
|
|
||
| download = item.at_css('a.za-download-href-link[href$=".deb"]')&.[] 'href' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a stupid question but wouldn't it be easier to use regex to find the link? The page might change easily over time especially in the html layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you consider that the page may change, using regex is just as unreliable (if not more) as CSS selectors. They are also less readable and maintainable than CSS selectors in my opinion.
e4f95cd to
5477b29
Compare
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.