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

[Question] Remove other language if prefered exists #27

Open
jerry1333 opened this issue Jul 26, 2024 · 3 comments
Open

[Question] Remove other language if prefered exists #27

jerry1333 opened this issue Jul 26, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jerry1333
Copy link

Hello,
is there a way to remove downloads from manifest for other languages than preferred?

I'm using
gogcli manifest generate --lang=polish --lang=english --os=windows
but some games have both languages available and i'm interested in only one (Polish in this example).
Can I somehow filter other languages out?

Example for The Witcher 3: Wild Hunt - Complete Edition

D:\gogcli>gogcli manifest search --title="The Witcher 3: Wild Hunt - Complete Edition"
{
  "Games": [
    {
      "Id": 1495134320,
      "Slug": "the_witcher_3_wild_hunt_game_of_the_year_edition_game",
      "Title": "The Witcher 3: Wild Hunt - Complete Edition",
      "CdKey": "",
      "Tags": [],
      "Installers": [
...
  ],
  "EstimatedSize": "185.26 GB",
  "VerifiedSize": 196994462426,
  "Filter": {
    "Titles": [
      "The Witcher 3: Wild Hunt - Complete Edition"
    ],
    "Oses": [
      "windows"
    ],
    "Languages": [
      "polish",
      "english"
    ],
    "Tags": [],
    "Installers": true,
    "Extras": true,
    "ExtraTypes": [],
    "SkipUrls": [
      "^/downloads/the_witcher_3_wild_hunt_game_of_the_year_edition_game/[a-z]{2,2}[0-9]patch[0-9]$"
    ],
    "HasUrls": [],
    "Intersections": []
  },
  "ProtectedFiles": null
}

This would allow to limit download time and size.

Thanks for any tips!

@Magnitus-
Copy link
Owner

Magnitus- commented Jul 27, 2024

Currently, there is no such feature, though it feels like it wouldn't be too complicated to implement.

However, if the number of games you need this for is relatively small (ie, only a handful of very large games), a feasible workaround would be to add individual installers to the "SkipUrls" field.

If I take the fallout classic entry for example, I have this:

      "Installers": [
        {
          "Languages": [
            "english"
          ],
          "Os": "windows",
          "Url": "/downloads/fallout_classic/en1installer0",
          "Title": "Fallout Classic",
          "Name": "setup_fallout_2.1.0.18.exe",
          "Version": "",
          "Date": "",
          "EstimatedSize": "502 MB",
          "VerifiedSize": 514057080,
          "Checksum": "47b7b3c059d92c0fd6db5881635277ea"
        },
        {
          "Languages": [
            "french"
          ],
          "Os": "windows",
          "Url": "/downloads/fallout_classic/fr1installer1",
          "Title": "Fallout Classic",
          "Name": "setup_fallout_french_2.1.0.18.exe",
          "Version": "",
          "Date": "",
          "EstimatedSize": "500 MB",
          "VerifiedSize": 513017720,
          "Checksum": "12ba5bb0489b5bafb777c8d07717b020"
        },
        {
          "Languages": [
            "spanish"
          ],
          "Os": "windows",
          "Url": "/downloads/fallout_classic/es1installer1",
          "Title": "Fallout Classic",
          "Name": "setup_fallout_spanish_2.1.0.18.exe",
          "Version": "",
          "Date": "",
          "EstimatedSize": "499 MB",
          "VerifiedSize": 511395528,
          "Checksum": "72c07bd7e7ae73cedebdc303aa3a104c"
        }
      ],

Say that I only wanted to keep the French installer and filter out both the English and Spanish installers, then my skip url field would look like that:

"SkipUrls": [
    ...,
    "^/downloads/fallout_classic/en1installer0$",
    "^/downloads/fallout_classic/es1installer1$"
],

I guess currently, those entries would have to be manually added to the manifest as the only existing gogcli command that add entries in the "SkipUrls" field is to skip patches, but adding a separate command to skip a set of languages should be trivial to implement.

Give me a couple of days and I'll do that (add a command to add languages to "SkipUrls") and push a release. I think I've done a couple of improvements on the main branch now that are not in any release tag.

@Magnitus- Magnitus- added the enhancement New feature or request label Jul 27, 2024
@Magnitus- Magnitus- self-assigned this Jul 27, 2024
@Magnitus-
Copy link
Owner

Magnitus- commented Aug 3, 2024

@jerry1333
fyi, using the last release, you can trim languages for a specific game in your manifest like so:

gogcli manifest trim-languages --id <id of your game> --lang french --lang polish ...

@jerry1333
Copy link
Author

Cool, I'll test it soon on next library update.
Thanks!

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

No branches or pull requests

2 participants