Skip to content

Commit 636746f

Browse files
authored
Fixed categories not being added to the output file (#3)
1 parent 1fd9d58 commit 636746f

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ Using the configuration file, the types and format of a large number of properti
88

99
Take a look at the section below to learn how to use the configuration file, or take a look at the [examples](examples) and work from there.
1010

11+
## Related projects
12+
13+
If you would like to know the Steam App ID's to the games that are on Game Pass, you can use the [Steam App ID Finder](https://github.com/NikkelM/Steam-App-ID-Finder).
14+
15+
You can then use the [Notion Steam API Integration](https://github.com/NikkelM/Notion-Steam-API-Integration) to automatically add information about those games to you Notion database.
16+
17+
And coming soon: You can alternatively directly use the `JSON to Notion` tool to create a new page in your Notion database for each game extracted using the `Game Pass API`.
18+
1119
## Setup
1220

1321
Run `npm install` to install the required dependencies first.
@@ -37,7 +45,7 @@ The project provides an extensive JSON validation schema for the required config
3745
The schema can be found in the `config.schema.json` file and used within your `config.json` by adding the following property:
3846

3947
```json
40-
"$schema": "./config.schema.json"
48+
"$schema": "config.schema.json"
4149
```
4250

4351
*NOTE: The script will test your provided `config.json` against this schema, so make sure your configuration is valid.*

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ function getCategories(game, categoriesProperty) {
364364
categories = game.Properties.Categories;
365365
}
366366
// Each game also has a "main" category, which may or may not be included in the list of categories
367-
if (!(game.Properties.Category in categories)) {
367+
if (!categories.includes(game.Properties.Category)) {
368368
categories.push(game.Properties.Category);
369369
}
370+
371+
return categories;
370372
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "game-pass-api",
33
"type": "module",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"description": "Utility for fetching all games currently available for Xbox Game Pass and formatting the resulting data according to user requirements.",
66
"main": "index.js",
77
"dependencies": {

0 commit comments

Comments
 (0)