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

Pack import fixes and improvements #1563

Merged
merged 8 commits into from Oct 13, 2023

Conversation

Trial97
Copy link
Member

@Trial97 Trial97 commented Aug 24, 2023

Multiple fixes and improvements regarding pack import:

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97 Trial97 added bug Something isn't working enhancement New feature or request changelog:added A PR that appears under "Added" in the changelog changelog:fixed A PR that appears under "Fixed" in the changelog labels Aug 24, 2023
@Trial97 Trial97 added this to the 8.0 milestone Aug 24, 2023
@TheKodeToad TheKodeToad changed the title Modrinth pack Pack import fixes and improvements Aug 24, 2023
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
@DioEgizio
Copy link
Member

wouldn't not selecting a mod = not downloading it make more sense? this behavior is kinda weird. Apart from that this pr seems fine

@Trial97
Copy link
Member Author

Trial97 commented Aug 27, 2023

Well not really: If you would want to add them later how would you know what mods need to be added and what version?
Some alternatives would be:

  • reading the manifest file and downloading the files yourself(that's not easy at all)
  • if you have access to a modlist compare it with the current one and again download the correct versions of the mods you want
  • reinstall the pack (this is the easier option) but would overwrite config and disabled mods

Also the previous implementation the mods are always downloaded but they are disabled if they are optional.

@DioEgizio
Copy link
Member

https://docs.modrinth.com/docs/modpacks/format_definition/#env-optional

The modrinth docs seem to prefer the behaviour I mentioned (which is honestly the one which makes the most sense to me and it's what launchers that have this option do, and what we do for atlauncher packs)

honestly it doesn't make much sense to have the page if you're still gonna download it but disabled anyways

@TheKodeToad
Copy link
Member

I think it's nice as it allows the user to review the mods which will be disabled by default

@Trial97
Copy link
Member Author

Trial97 commented Aug 27, 2023

In the documentation, I do not see anywhere how should I handle the unselected resources(doesn't say that I should not download them).
I still want to keep them downloaded: in case you want to enable an optional mod in the future.
Also checked against :

  • curseforge downloads the optional and marks them as disabled
  • modrinth downloads the optional and doesn't mark them as disabled

All of them download the optional files.

@TheKodeToad
Copy link
Member

I assume in the case of Modrinth it is either unimplemented or a bug :P

@TheKodeToad
Copy link
Member

Maybe we should stop checking extension and just add .disabled?

@Trial97
Copy link
Member Author

Trial97 commented Aug 27, 2023

I thought that was something modrinth does, on flame there is no such check.
I just copied the code from the previous implementation so we can drop it

@TheKodeToad
Copy link
Member

TheKodeToad commented Aug 27, 2023

Not necessarily in this pr - but resource packs etc. can also be optional

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into modrinth_pack

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@nopeless
Copy link

hey @Trial97 , I like the pull request, but I think [^a-zA-Z0-9] is too restrictive.

something like [\0-\31\/:*?"<>|] would be better

@Trial97
Copy link
Member Author

Trial97 commented Sep 22, 2023

Hi @nopeless,
I'm not sure as I understand what you want to achieve with the new regex.
Why the need to change that?
Do we have collisions between the ATLauncher packs with the current regex?
We use that field only for the logo filename so if there are no collisions between the packs I would prefer to remain the same.

@nopeless
Copy link

Hi @nopeless,
I'm not sure as I understand what you want to achieve with the new regex.
Why the need to change that?
Do we have collisions between the ATLauncher packs with the current regex?
We use that field only for the logo filename so if there are no collisions between the packs I would prefer to remain the same.

No, and I doubt there will be any collisions unless the filename is unicode (which is very unlikely either)

However, I don't see why the regexp has to be so restrictive either. If it needs to be filename safe, then the regex should show that intent.

At the very least, I think you should add a space to the allow character list so spaces are preserved for easier reading in case of a need to debug.

@nopeless
Copy link

Or I may have misread the code I'm assuming safeName is for storing in local. If there's another use for it, I can see where I'm wrong

@Trial97
Copy link
Member Author

Trial97 commented Sep 22, 2023

That name is precisely only used when we import the pack to give the name of the icon of the pack, nothing else.
And I stand firm in my decision to not change the regex.
Obviously, if you understand what you do please open a PR with your suggested change, and explain why we would want that.

Copy link
Member

@TayouVR TayouVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything seems to work in my testing.

this "Create Extra" pack from mr confused me a bit as it seems to put a lot of libraries like fabric API and fabric language kotlin, etc. as optional. But I guess thats just how it is..
It seems a bit odd to me, but I have to assume its just the pack making weird choices in what should be optional and what not...

UNLESS thats something coming from prism due to some dependency resolution stuff that needs to be considered here? thats just how the pack comes, imma merge

image

@TayouVR TayouVR merged commit 7015b8f into PrismLauncher:develop Oct 13, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog:added A PR that appears under "Added" in the changelog changelog:fixed A PR that appears under "Fixed" in the changelog enhancement New feature or request
Projects
None yet
5 participants