Kesomannen / gale

The lightweight mod manager
https://kesomannen.com/gale
GNU General Public License v3.0
124 stars 12 forks source link

Mod order is lost when importing to r2modman #127

Closed minimusubi closed 2 weeks ago

minimusubi commented 1 month ago

Description

When you export a mod profile from Gale (with either a file or a code) and import it into r2modman, the custom mod sorting order is lost. Seeing as how this does not happen when exporting from r2modman to r2modman and from r2modman to Gale, this appears to be a Gale bug.

Reproduction

  1. Setup a mod profile in r2modman
  2. Import the mod profile from r2modman into Gale
  3. Observe that when sorting by custom order ascending, the mod list is in the same order
  4. Export the mod profile (either as file or code)
  5. Import the mod profile to r2modman
  6. Observe that when sorting by custom order standard, the mod list is no longer in the same order
Kesomannen commented 1 month ago

Seems like an issue with r2modman. bild On the left is the manifest that gale created, on the right the profile r2modman got from that, which is all jumbled up

Georg9741 commented 1 month ago

It also happens in Thunderstore, definitly a problem how Gale generates profiles (files and codes).

Kesomannen commented 1 month ago

I have no idea what Gale could be doing wrong here, from the screenshot above it really seems r2modman is scrambling them up

Kesomannen commented 1 month ago

I think I understand now. Looks like r2modman orders mods by the author's name when importing, whereas Gale takes the order from the export manifest.

bild bild

Here you can see a profile I first exported from Gale, then imported into r2 and finally exported from r2. You can see the that in r2modman, mods with an author starting with A comes first, B after that and so on. If I import the file that r2 exported into r2 again, the mods are in the same order.

I believe gale has the correct behavior here, since you don't want any custom ordering to be undone.

Georg9741 commented 1 month ago

If I copy a code from r2/thunderstore the mod order is saved after importing to r2/thunderstore, so the codes/files from gale are at fault

Kesomannen commented 1 month ago

Yeah that's super weird. Maybe it reads gale from the source field and does something different based on that? Seems unlikely though, as r2modman doesn't even populate that field itself

minimusubi commented 1 month ago

It seems that r2modman is using a mods.yml file to define a custom sort order. Gale does not generate this file, while r2modman does.

Reproduction

  1. Setup a mod profile in r2modman
    • Make sure the custom sort order is in such a way that it's not ordered alphabetically by author
  2. Export the profile as a file from r2modman
  3. Import r2modman's profile file into Gale
  4. Observe the mod order is correct
  5. Export the profile as a file from Gale
  6. Import Gale's profile file into r2modman
  7. Observe the mod order is incorrect
  8. Copy the mods.yml from the r2modman export into Gale's export
  9. Import the profile file into r2modman
  10. Observe the mod order is correct
minimusubi commented 1 month ago

@Kesomannen is this worth adding to Gale (even a stripped down version of mods.yml, if that works in r2modman) to fix this issue

Kesomannen commented 1 month ago

Seems like something really broke with the latest update of r2modman. Now profile codes from gale import into r2 but without anything showing up in the mod list (but the mods and config are still imported fine). It's weird because I can't find anywhere in the r2 code where it reads from the mods.yml file, only export.r2x. I'll keep digging but I guess gale is going to have to generate a mods.yml file to fix this :/

Kesomannen commented 2 weeks ago

Seems to be fixed now