Cimbali / pympress

Pympress is a simple yet powerful PDF reader designed for dual-screen presentations
https://cimbali.github.io/pympress/
GNU General Public License v2.0
1.18k stars 89 forks source link

Fixed winget badge #322

Closed paulo-haas closed 3 months ago

paulo-haas commented 3 months ago

This PR fixes the winget badge issue. Repology no longer tracks the winget repository (Issue #1392).

This solution leverages the GitHub API to fetch the contents of the pympress winget directory and displays the name of the last. The contents of the winget directory are named and sorted by version. This solution works as long as the versioning sticks to the semantic versioning rules, but might need adjustments in the future.

Cimbali commented 3 months ago

Is this sorting guaranteed with multiple digits, or is it purely alphabetical? I.e. does 1.10.0 sort before or after 1.8.5?

Cimbali commented 3 months ago

Ah it seems it’s alphabetical, look for example at Firefox, where the 96.x versions come after all the ≥ 100.x versions:

https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/Mozilla/Firefox

Probably need some smarter sorting to merge this.

Cimbali commented 3 months ago

The winget API doesn’t look particularly up to date either.

paulo-haas commented 3 months ago

Oh, yeah, it is sorted alphabetically. I somehow did not think about that. So my solution will break earlier than expected. You could also never go beyond 9.9 :-D But I give myself a gold star for my effort :'-)

The winget API of winget.run is not an official API and seems to be abandoned. There are many issues with out-of-date packages.

I did not find any alternative solution right now, but I will keep this problem in mind and get back to it.