Fixed mod updates not fetching correct URL - #105
Conversation
|
I am thinking a better solution could be removing the use of As for the "Check for mod updates" option, there is no implementation to display the updates yet, so it isn't called. |
Sure, I will change to this and test. Update: |
I changed to use the helper for cleaner implementation. ex for: public UpdateSourceHMM(IMod mod, Uri baseURI)
{
BaseURI = baseURI;
Mod = mod;
} public UpdateSourceHMM(IMod mod, Uri baseURI)
{
- BaseURI = baseURI;
+ BaseURI = Helpers.EnsureEndsInSlash(baseURI); // would add `/` if not in mod ini (most mods dont have it), and do nothing otherwise
Mod = mod;
} |
|
I don't think Another solution could be just adding var server = mainSection.Get("UpdateServer", string.Empty);
- if (Uri.TryCreate(server, UriKind.Absolute, out Uri? uri))
+ if (Uri.TryCreate(server.TrimEnd('/') + '/', UriKind.Absolute, out Uri? uri))
{
Updater = new UpdateSourceMulti(this, uri);
}Edit: You can also make that into a function in the helper class if you think this looks too confusing, simlar code is used in that class aswell. |
Correct, in the above I mistakenly referenced the wrong file. Per the actual changes it would be in GMI. I think I like the ModGeneric solution personally. I'll change to that and test. |
|
ModGeneric solution works as expected 👍 |
thesupersonic16
left a comment
There was a problem hiding this comment.
Aside from the function name, I think this PR looks good. Please change the name to something that is less mis-leading to those who don't check the function description.
Resolves #104
Tested on both Windows and Linux
Note: This PR only fixes the broken update functionality. The 'check on startup' is still broken and is unrelated to this PR.