Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pics Cache Enhancements #409

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1240f7d
Added savePicsCache
Revadike Mar 9, 2022
0321d67
update jsdoc
Revadike Mar 11, 2022
aa2cc26
fix jsdoc
Revadike May 20, 2022
a9bd0cf
issue warning for picsCacheAll+savePicsCache
Revadike May 20, 2022
c0afe04
_saveProductInfo jsdoc
Revadike May 20, 2022
488a74a
savePicsCache functionality
Revadike May 20, 2022
24eb205
current changenumber to disk
Revadike May 20, 2022
3d45029
read changenumber on startup
Revadike May 20, 2022
ec7aa5d
altered warning
Revadike May 21, 2022
84bfec3
spelling
Revadike May 21, 2022
5de1d35
implement product info cache
Revadike May 21, 2022
1a4e46d
a lot of bugfixes
Revadike May 22, 2022
e514b50
corrected cached object
Revadike May 22, 2022
61bf5ca
file-manager@2.0.1
Revadike May 22, 2022
571b5d3
split product info requests
Revadike Jun 2, 2022
58b0b70
fixed deadlock issue
Revadike Jun 2, 2022
2fd5ee0
bugfixes + small changes
Revadike Jun 3, 2022
3249f29
Prevent any stale data with meta_data_only + sha check
Revadike Jun 17, 2022
ff77442
improve readme
Revadike Jun 19, 2022
fd813a7
fixed anonymous usage
Revadike Jun 19, 2022
395ddeb
Merge branch 'master' into feature-picscache-enhancements
Revadike Jun 19, 2022
b8c3791
small changes
Revadike Jul 4, 2022
2b0fa8a
handle when `sha` is `null`
Revadike Jul 7, 2022
037feac
minor bugfix
Revadike Jul 19, 2022
f3a725e
comments + refactor + handle enablePicsCache disabled
Revadike Jul 22, 2022
134ee79
Changed execution order
Revadike Jul 31, 2022
bfbc033
Merge branch 'DoctorMcKay:master' into feature-picscache-enhancements
Revadike Oct 12, 2022
629ca25
Merge branch 'DoctorMcKay:master' into feature-picscache-enhancements
Revadike Jan 7, 2023
6c44782
Merge branch 'master' of https://github.com/DoctorMcKay/node-steam-us…
Revadike Jun 23, 2023
9c06413
Merge branch 'master' into feature-picscache-enhancements
Revadike Jul 22, 2023
944601a
Merge pull request #3 from DoctorMcKay/v4
Revadike Oct 20, 2023
4055403
Merge branch 'master' into feature-picscache-enhancements
Revadike Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.enable": false
}
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ user.storage.on('read', function(filename, callback) {
});
```

In this manner, you can save data to a database, a cloud service, or anything else you choose.
In this manner, you can save data to a database, a cloud service, or anything else you choose. If both [`savePicsCache`](#savePicsCache) and [`picsCacheAll`](#picsCacheAll) are enabled, it is possible to maintain your own Steam database this way.

### autoRelogin

Expand Down Expand Up @@ -175,6 +175,16 @@ Added in 3.3.0.

Defaults to `false`.

### savePicsCache

If `enablePicsCache` is enabled, saves all product info from [the PICS cache](#picscache) to disk (in [`dataDirectory`](#dataDirectory)) or to your [Custom Storage Engine](#custom-storage-engine). This will significantly speed up the [`appOwnershipCached`](#appOwnershipCache) event from firing and reduce the amount product info requests to Steam. It will only save product info if it's not missing its access token.

Added in {{TODO}}

Defaults to `false`.

**Warning:** Mind that this will significantly increase the storage usage and space!

### picsCacheAll

If `picsCacheAll` is enabled, `enablePicsCache` is enabled, and `changelistUpdateInterval` is nonzero, then apps and
Expand Down Expand Up @@ -879,6 +889,7 @@ Requests a list of game servers from the master server.
- `callback` - Called when requested data is available
- `err` - An `Error` object on failure, or `null` on success
- `apps` - An object whose keys are AppIDs and whose values are objects
- `sha` - The SHA hash of the app info in hex format (useful to compare to old data)
- `changenumber` - The changenumber of the latest changelist in which this app changed
- `missingToken` - `true` if you need to provide an access token to get more details about this app
- `appinfo` - An object whose structure is identical to the output of `app_info_print` in the [Steam console](steam://nav/console)
Expand Down
13 changes: 13 additions & 0 deletions components/05-filestorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
}
}

/**
* @param {Object} files - Keys are filenames, values are Buffer objects containing the file contents
* @return {Promise}
* @protected
*/
async _saveFiles(files) {
if (!this.storage) {
return Promise.reject(new Error('Storage system disabled'));
}

return await this.storage.saveFiles(files);
};

Check failure on line 31 in components/05-filestorage.js

View workflow job for this annotation

GitHub Actions / lint / lint

Unnecessary semicolon

/**
* @param {string} filename
* @returns {Promise<Buffer|null>}
Expand Down
Loading