Add "import whitelisted games only" feature #48
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 awhitelist.txt
file in the itch integration directory and adds each line in that file to a list. I've also slightly modifiedget_owned_games
andparse_json_into_games
to have the following behaviour: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 awhitelist.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.