EmilStenstrom / mybgg

A template that lets you quickly set up a site for searching and filtering your boardgames.
https://games.emilstenstrom.se
MIT License
61 stars 132 forks source link

Ability to include expansions? #5

Closed akelley closed 6 years ago

akelley commented 6 years ago

I wanted to include the expansions I have for games in the returned collection. But after trying to configure the config boardgamegeek object i wasn't able to figure out where to add it. Looking at the API page - https://lcosmin.github.io/boardgamegeek/modules.html#boardgamegeek.api.BGGClient.collection - it looks like it should be possible via subtype, but i could not get a successful call with the subtype attribute.

  "boardgamegeek": {
        "user_name": "####",
        "subtype": "boardgame,boardgameexpansion",
        "extra_params": {
            "own": 1
        }
    },
EmilStenstrom commented 6 years ago

Hi @kelleyaj! Great suggestion. I had hardcoded the removal of all expansions, since I only wanted games... I just moved that to the config file instead, so you can just remove that part and expansions should be automatically included. Does that work for you?

Here are the code changes that make this possible: https://github.com/EmilStenstrom/mybgg/commit/c6ef7a87974c6e79db187f766592508f7d6dc416

akelley commented 6 years ago

That works thanks! But maybe we should add a filter to the right side bar to show or hide expansions? I can look into that, or if you know what file to point me to.

EmilStenstrom commented 6 years ago

I think most people won't want expansions at all (use-case is (i think) picking a game for the game night), so they will just have it excluded using the settings in config.json. The use-case for filtering is if you sometimes want expansions, and sometimes not.

Is that why you want the filter?

akelley commented 6 years ago

@EmilStenstrom yes that is the use case. It can be taken a little further to add more value as most of my expansions add the ability to play with more players. So when planning a game night the group would need to know if I have the expansion or not to know how many players we could have. So if would be great to be able to have expansions be there and filtered out by default, but have the ability to show the expansions for that purpose. Does that make sense?

EmilStenstrom commented 6 years ago

I wonder, how are the expansions categorized? If the base game is four players, and an expansions adds a fifth, does only the expansion show up when you filter for five players? Or is the base game categorized as supporting five players since there's an expansion you could have?

Another option I see is to add expansions, and connect them to each game in the filtering/search. So each game would be categorized as the maximum number of players any of your expansions have?

akelley commented 6 years ago

If the base game is four players, and an expansions adds a fifth, does only the expansion show up when you filter for five players?

Yes this is the case. For example I have Catan which is up to 4 players, and I then have the 5-6 player expansion. When filtering for number of players 5 or more only the Catan expansion is shown.

Another option I see is to add expansions, and connect them to each game in the filtering/search. So each game would be categorized as the maximum number of players any of your expansions have?

I think this is a good idea, if it would be possible to denote if the user has the expansion with the base game and then merge that number of players and/or other data fields it would make it pretty seamless.

EmilStenstrom commented 6 years ago

Excellent, I see how this would be useful for me too. I'll see if I can get it working, but it might take a little while, because this is a bigger change.

akelley commented 6 years ago

Awesome. Let me know if there is anything I can help out on.

EmilStenstrom commented 6 years ago

Hi again! I think I got everything working like you suggested. You can see it working here: https://games.emilstenstrom.se/?query=Carcassonne (which adds a fifth player with expansions)

I decided that I didn't need to connect the specific expansion that allows for more players, that the owner of the games probably already knows that.

How does that work for you?

akelley commented 6 years ago

This is great, thank you for getting this in @EmilStenstrom 🥇