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

Add "import whitelisted games only" feature #48

Merged
merged 1 commit into from
Aug 8, 2021
Merged

Add "import whitelisted games only" feature #48

merged 1 commit into from
Aug 8, 2021

Conversation

pericles-tpt
Copy link
Contributor

What

I've implemented a small additional feature for your gog itch integration, that would give users the option of only importing games listed on a whitelist.

Why

I thought this would be a useful feature to have for users with a large library of games on itch (potentially from bundles that have 1000+ games). It would allow them to specify a smaller list of games that they want to import rather than their entire library.

How

I've added a small function in itch.py that reads from a whitelist.txt file in the itch integration directory and adds each line in that file to a list. I've also slightly modified get_owned_games and parse_json_into_games to have the following behaviour:

  • If the whitelist file doesn't exist or is empty the app will add every games in the user's library (like before).
  • Otherwise it'll check each game against the whitelist and only add games that appear in that whitelist.

Testing

I tested the changes on Windows where I copied my modified itch.py file to the itch integration folder in the gog plugins directory. I also created a whitelist.txt file in the same directory and connected the plugin in GOG Galaxy 2.0, the integration had the expected behaviour of only importing the games whose names appeared in the whitelist file.

@pericles-tpt
Copy link
Contributor Author

I forgot to mention this above but this change was tested on Windows 10 specifically and I also just tested it without the whitelist.txt file in the itch plugin directory and it imports every game in my library (as expected).

@tauqua tauqua merged commit 55c70fa into tauqua:master Aug 8, 2021
@pericles-tpt pericles-tpt deleted the whitelist-import branch August 8, 2021 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants