sharkwouter / minigalaxy

A simple GOG client for Linux
https://sharkwouter.github.io/minigalaxy/
GNU General Public License v3.0
1.09k stars 70 forks source link

Feature: Filter games by category #573

Closed orende closed 1 year ago

orende commented 1 year ago

Description

This PR addresses issue #543.

The PR adds a dialog that can be used to filter the games library based on game categories. Enabling one category filters shows only games matching the selected category, while enabling multiple category filters shows games matching any of the selected categories. The games and associated categories are stored on disk in the user's cache directory to allow for filtering in offline mode. Once the client goes online again, the file will be updated with any new games and categories found.

Note that this solution uses the category field as returned by the call to embed.gog.com/account/getFilteredProducts and not the genres field as returned by the call to gamesdb.gog.com/platforms/gog/external_releases. This is because the former requires only a single API call, while the latter initially requires one API call per game in the library.

Searching for categories, as proposed in the issue, was left out as the total number of categories was low (8 in total).

The PR also replaces all print statements with the logger library for ease of debugging.

Checklist

sharkwouter commented 1 year ago

Looks good, thanks for this! I've found the icon does not load, otherwise I'd merge it.

sharkwouter commented 1 year ago

Thanks! That works!