jakobkmar/pacmc

mod name in file name

Closed this issue · 14 comments

Hi, I think it would be nice, if the filename of the .jar would contain the actual mod's name instead of a string of characters (for example pacmc_modrinth_indium.jar instead of pacmc_modrinth_Orvt0mRa_1ApUEVoW_0.jar.

Hey, I totally get that these names aren't optimal if you manually look into your mods folder, but there is a good reason for them:

Without storing the mod and version id in the filename itself, pacmc would have to maintain a separate file or database, where it stores which file is what. This could lead to major inconsistencies, causing pacmc to lose control over the files and not even pacmc refresh being able to fix this without manual intervention.

I hope you understand this and those filenames aren't too bad. :)

(Also, please note that these files shouldn't be touched manually anyway, as they are managed by the package manager. And for listing your mods there is always pacmc list.)

Would it not be possible to just append/prepend the name of the mod to the filename?

That would be possible, but this way filenames would get really long, and if I remember correctly windows has a pretty low file name length limit.

Doubt that's going to be the problem
Screenshot_2021 12 16_22:12:18

How is naming/getting a file by name currently handled? Do you identify pacmc files by the pacmc at the start?

Doubt that's going to be the problem Screenshot_2021 12 16_22:12:18

yeah it can be enabled, but it is not enabled by default

How is naming/getting a file by name currently handled? Do you identify pacmc files by the pacmc at the start?

correct, the pacmc_ at the beginning (and whether the rest of the file name is correct) identifies a pacmc mod file

Filenames right now are roughly 35 chars long, if we remove "pacmc" and replace hosting with 2 letter equivalent (CF / MR) these names are reduced to something like 23.
You could still identify files but this time by directly checking the hosting.

Also, what precisely is the file name limit on Windows?
I wasn't aware of one and making the mods folder less managable is not a good idea.
Even though we use pacmc to manage mods, sometimes it's required to manually intervene and having a name of the mod would be nice.

I also think something needs to be changed about the file names, I am just not quite sure yet in which way, the one with the repository as the prefix definitely is a valid option.

I kind of decided to use the following scheme (examples):
Modrinth Sodium: mr_sodium_AANobbMI.jar
CurseForge Fabric API: cf_fabric_api_306612.jar

So its repo, slug, modid

For no reasons other than organization and cohesion, I personally feel that repo, modid, slug would work better. The beginning of the slug would happen at roughly the same character for every mod, which would increase readability greatly, e.g. when scanning down your modlist. That being said, I suppose you trade off the alphabetical organization of your mods by their slug.

mh not sure, I prefer the first approach, because users want to see the slug, and placing it at the front of the file name helps making it clearer if you don't care about the modid

The beginning of the slug would happen at roughly the same character for every mod

that would also be the case with the other approach, as the repo will always be a 2 character string

You see you make some excellent points. I was fairly tired when I made that comment my apologies 😅

In the future, mod files will have this structure.