Skip to content

Conversation

@cibere
Copy link
Contributor

@cibere cibere commented Feb 5, 2025

This PR fixes #459 using the potential solution I mentioned there.

Quick Overview

Instead of fetching the first release artifact, check the amount of assets, and if there are more than 1, attempt to find one with the same name as the current download url. If there is only 1 asset, or no asset with the same filename could be found, then default to the first asset.

This would leave the current behavior for plugins that have their own repository, but for plugins that share a repository, would require the plugin dev to ensure the proper artifact names correspond to the correct plugin.

When it comes to getting the original filename, I decided to use a regex:

https://github\.com/(?P<author>[a-zA-Z0-9-]+)/(?P<repo>[a-zA-Z0-9\.\-\_]*)/releases/download/(?P<version>[a-zA-Z\.0-9]+)/(?P<filename>.*)\.zip

which I've tested against the current set of plugins, and made it fit the username/repo name requirements that I could find.

If you want me to move away from the regex, to something like this:

filename = info[url_download].split("/")[-1]

then lmk.

I also went ahead and fixed the urls in the Search Unicode - Identify and Search Unicode - Search plugins so that another PR isn't needed to do that

@prlabeler prlabeler bot added the bug Something isn't working label Feb 5, 2025
@cibere cibere self-assigned this Feb 5, 2025
@cibere
Copy link
Contributor Author

cibere commented Feb 5, 2025

Not exactly sure why the link checker workflow is failing. It says a configuration error, but it only seems to fail on this PR

@cibere cibere requested a review from jjw24 February 5, 2025 18:34
@cibere cibere enabled auto-merge February 6, 2025 20:17
@cibere cibere merged commit 9fd33c0 into Flow-Launcher:plugin_api_v2 Feb 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] wrong download url for plugins that share a repo

2 participants