Paginated admin library & upgrade manifests (#351)

* feat: new page layout + endpoint

* feat: non-parallel mass import

* feat: paginated admin library

* feat: lint and performance improvement

* feat: library filter util

* feat: link frontend features to backend

* fix: lint

* fix: small fixes

* feat: bump torrential

* fix: lint
This commit is contained in:
DecDuck
2026-02-25 02:17:33 +11:00
committed by GitHub
parent 1ad881721e
commit dbe34684d8
35 changed files with 1823 additions and 416 deletions
+16 -6
View File
@@ -21,23 +21,33 @@ class GameSizeManager {
private gameBreakdownCache =
cacheHandler.createCache<GameSizeBreakdown>("gameBreakdown");
private gameVersionSizeCacheKey(versionId: string, previousId?: string) {
return `${versionId}${previousId ? `-from-${previousId}` : ""}`;
}
/***
* Gets the size of the game to the user:
* - installSize: size on disk after install
* - downloadSize: how many bytes are downloaded (but not necessarily stored)
*/
async getVersionSize(versionId: string): Promise<GameVersionSize | null> {
if (await this.gameVersionsSizesCache.has(versionId))
return await this.gameVersionsSizesCache.get(versionId);
async getVersionSize(
versionId: string,
previousId?: string,
): Promise<GameVersionSize | null> {
const key = this.gameVersionSizeCacheKey(versionId, previousId);
if (await this.gameVersionsSizesCache.has(key))
return await this.gameVersionsSizesCache.get(key);
try {
const { downloadSize, installSize } =
await createDownloadManifestDetails(versionId);
const { downloadSize, installSize } = await createDownloadManifestDetails(
versionId,
previousId,
);
const result = {
downloadSize,
installSize,
versionId,
} satisfies GameVersionSize;
await this.gameVersionsSizesCache.set(versionId, result);
await this.gameVersionsSizesCache.set(key, result);
return result;
} catch {
return null;