tauqua / gog-galaxy-itch.io

An integration connecting itch.io to GOG Galaxy 2.0 using itch's v2 API
GNU General Public License v3.0
220 stars 14 forks source link

Add "import whitelisted games only" feature #48

Closed pericles-tpt closed 3 years ago

pericles-tpt commented 3 years ago

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:

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 commented 3 years ago

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).