Skip to content
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

Error correction for adding repos to marketplace #229

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

doctor112-1
Copy link

@doctor112-1 doctor112-1 commented Feb 24, 2025

Adding repos to the marketplace might be a bit confusing for the first time. Some people may try to add the repo directly like github.com/MercuryWorkshop/anura-repo/ instead of https://raw.githubusercontent.com/MercuryWorkshop/anura-repo/master/. This adds some error correction like adding https:// to the beginning if it doesn't have it, fixing the link if it is github.com to raw.githubusercontent.com and adding to the end of the link /master/. It also adds backward compatibility when adding older repos to the marketplace.

@ProgrammerIn-wonderland
Copy link
Collaborator

Ooh I like this

@ProgrammerIn-wonderland
Copy link
Collaborator

I'll review in the morning

@ProgrammerIn-wonderland
Copy link
Collaborator

This is good in concept however some people won't be hosting repos on GitHub, this PR seems to assume any repo not starting with rawgithubusercontent is wrong which isn't necessarily true, a notable example being https://games.anura.pro/list.json. could you fix this to explicitly detect https://GitHub.com and then fix it instead of detecting the absence of rawgithubusercontent?

@doctor112-1
Copy link
Author

Ah ok my bad. I'll fix it.

@doctor112-1
Copy link
Author

Should be fixed, though I couldn't get https://games.anura.pro/ working though it's not a conflict arising from the error correction since it doesn't give any messages that it would give if it was the error correction.
This was the errors it was giving.
image

@Endercass
Copy link
Member

Why is it trying to load manifest.json? anura games is in the legacy format, it should only load list.json

@Endercass
Copy link
Member

Also, consider utilizing the Url constructor instead of manual string manipulation, just a suggestion :D

@doctor112-1
Copy link
Author

The addRepo code will automatically try to find a manifest.json for any repo that is entered, even if you add the list.json at the end of it. The good thing is the repo is already added before load which I think bypasses the whole checking for the manifest.json file. Two ways to fix this issue would either be to add backwards compatibilty in the addRepo code, or just update the games.anura.pro repo.

@Endercass
Copy link
Member

Backwards compatibility is already implemented for anura repositories, see Marketplace | Anura Games @ https://anura.pro

@doctor112-1
Copy link
Author

I meant that when you add repositories, the code always checks for a manifest.json. The backwards compatibility would be need added there.

@doctor112-1
Copy link
Author

I added backward compatibility for older repos when adding them to the marketplace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants