From a75b200d7d45c53632a09c90e7d16ce840681d24 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 29 Feb 2024 18:19:52 +0800 Subject: [PATCH 1/5] fix: `The stream is already locked` in monitor mode --- src/app.ts | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/app.ts b/src/app.ts index 7c214af..2455b48 100644 --- a/src/app.ts +++ b/src/app.ts @@ -275,11 +275,13 @@ export class App { ); } }; - const endBar = () => { - bar?.end(); - }; + const end = () => bar?.end(); - return { redraw, endBar }; + return { + redraw, + end, + [Symbol.dispose]: end, + }; } private async exportOnce() { const splatnet = new Splatnet3({ profile: this.profile, env: this.env }); @@ -300,7 +302,7 @@ export class App { splatnet, ); - const { redraw, endBar } = this.exporterProgress("Export vs games"); + using bar = this.exporterProgress("Export vs games"); const fetcher = new GameFetcher({ cache: this.opts.cache ?? new FileCache(this.profile.state.cacheDir), state: this.profile.state, @@ -320,7 +322,7 @@ export class App { gameListFetcher, stepProgress: stats[e.name], onStep: () => { - redraw(e.name, progress(stats[e.name])); + bar.redraw(e.name, progress(stats[e.name])); }, }), ) @@ -331,7 +333,7 @@ export class App { ), ); - endBar(); + await bar.end(); this.printStats(stats); if (errors.length > 0) { @@ -353,7 +355,7 @@ export class App { } else { const gameListFetcher = new CoopListFetcher(splatnet); - const { redraw, endBar } = this.exporterProgress("Export coop games"); + using bar = this.exporterProgress("Export coop games"); const fetcher = new GameFetcher({ cache: this.opts.cache ?? new FileCache(this.profile.state.cacheDir), state: this.profile.state, @@ -371,7 +373,7 @@ export class App { gameListFetcher, stepProgress: stats[e.name], onStep: () => { - redraw(e.name, progress(stats[e.name])); + bar.redraw(e.name, progress(stats[e.name])); }, }), ) @@ -382,7 +384,7 @@ export class App { ), ); - endBar(); + await bar.end(); this.printStats(stats); if (errors.length > 0) { @@ -466,14 +468,17 @@ export class App { display: "[:bar] :completed/:total", }) : undefined; - for (const i of Array(sec).keys()) { - bar?.render([{ - completed: i, - total: sec, - }]); - await delay(1000); + try { + for (const i of Array(sec).keys()) { + bar?.render([{ + completed: i, + total: sec, + }]); + await delay(1000); + } + } finally { + await bar?.end(); } - bar?.end(); } async run() { await this.profile.readState(); @@ -560,7 +565,7 @@ export class App { } printStats(stats: Record) { this.env.logger.log( - `Exported ${ + `\nExported ${ Object.entries(stats) .map(([name, { exported }]) => `${name}: ${exported}`) .join(", ") From 14405e996f7bc70661c684c277143575ba1e4219 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 29 Feb 2024 18:20:32 +0800 Subject: [PATCH 2/5] feat: add Fresh Season 2024 --- src/VersionData.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/VersionData.ts b/src/VersionData.ts index 7dcb475..2cac5c1 100644 --- a/src/VersionData.ts +++ b/src/VersionData.ts @@ -42,6 +42,12 @@ export const SEASONS: Season[] = [ start: new Date("2023-12-01T00:00:00+00:00"), end: new Date("2024-03-01T00:00:00+00:00"), }, + { + id: "season202403", + name: "Fresh Season 2024", + start: new Date("2024-03-01T00:00:00+00:00"), + end: new Date("2024-06-01T00:00:00+00:00"), + }, ]; export const getSeason = (date: Date): Season | undefined => { From cab8af8e31814905a6186a430e00b11d26676455 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 29 Feb 2024 18:21:34 +0800 Subject: [PATCH 3/5] chore: bump version --- CHANGELOG.md | 6 ++++++ gui/src-tauri/tauri.conf.json | 2 +- src/constant.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09b4383..5703c9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.4.16 + +fix: `The stream is already locked` in monitor mode + +feat: add Fresh Season 2024 + ## 0.4.15 feat: add znca headers ([#95](https://github.com/spacemeowx2/s3si.ts/issues/95)) diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.json index 68aebd0..1d4f46e 100644 --- a/gui/src-tauri/tauri.conf.json +++ b/gui/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "s3si-ts", - "version": "0.4.15" + "version": "0.4.16" }, "tauri": { "allowlist": { diff --git a/src/constant.ts b/src/constant.ts index 45cbb06..c061de0 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -1,7 +1,7 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts"; export const AGENT_NAME = "s3si.ts"; -export const S3SI_VERSION = "0.4.15"; +export const S3SI_VERSION = "0.4.16"; export const NSOAPP_VERSION = "2.9.0"; export const WEB_VIEW_VERSION = "6.0.0-eb33aadc"; export enum Queries { From 7b18e23988dabcbed52057c47ad718179b375e44 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 29 Feb 2024 18:29:21 +0800 Subject: [PATCH 4/5] style: fix lint --- src/app.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.ts b/src/app.ts index 2455b48..ef27433 100644 --- a/src/app.ts +++ b/src/app.ts @@ -302,7 +302,7 @@ export class App { splatnet, ); - using bar = this.exporterProgress("Export vs games"); + using bar1 = this.exporterProgress("Export vs games"); const fetcher = new GameFetcher({ cache: this.opts.cache ?? new FileCache(this.profile.state.cacheDir), state: this.profile.state, @@ -322,7 +322,7 @@ export class App { gameListFetcher, stepProgress: stats[e.name], onStep: () => { - bar.redraw(e.name, progress(stats[e.name])); + bar1.redraw(e.name, progress(stats[e.name])); }, }), ) @@ -333,7 +333,7 @@ export class App { ), ); - await bar.end(); + await bar1.end(); this.printStats(stats); if (errors.length > 0) { @@ -355,7 +355,7 @@ export class App { } else { const gameListFetcher = new CoopListFetcher(splatnet); - using bar = this.exporterProgress("Export coop games"); + using bar2 = this.exporterProgress("Export coop games"); const fetcher = new GameFetcher({ cache: this.opts.cache ?? new FileCache(this.profile.state.cacheDir), state: this.profile.state, @@ -373,7 +373,7 @@ export class App { gameListFetcher, stepProgress: stats[e.name], onStep: () => { - bar.redraw(e.name, progress(stats[e.name])); + bar2.redraw(e.name, progress(stats[e.name])); }, }), ) @@ -384,7 +384,7 @@ export class App { ), ); - await bar.end(); + await bar2.end(); this.printStats(stats); if (errors.length > 0) { From 96a2607da58f3a1261e467723042b72673a987f0 Mon Sep 17 00:00:00 2001 From: imspace Date: Fri, 10 May 2024 19:06:26 +0800 Subject: [PATCH 5/5] feat: update `WEB_VIEW_VERSION` and `NSOAPP_VERSION` --- CHANGELOG.md | 4 ++++ gui/src-tauri/tauri.conf.json | 2 +- src/constant.ts | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5703c9e..bf52d64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.17 + +feat: update `WEB_VIEW_VERSION` and `NSOAPP_VERSION` + ## 0.4.16 fix: `The stream is already locked` in monitor mode diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.json index 1d4f46e..0815ebd 100644 --- a/gui/src-tauri/tauri.conf.json +++ b/gui/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "s3si-ts", - "version": "0.4.16" + "version": "0.4.17" }, "tauri": { "allowlist": { diff --git a/src/constant.ts b/src/constant.ts index c061de0..aac057a 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -1,9 +1,9 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts"; export const AGENT_NAME = "s3si.ts"; -export const S3SI_VERSION = "0.4.16"; -export const NSOAPP_VERSION = "2.9.0"; -export const WEB_VIEW_VERSION = "6.0.0-eb33aadc"; +export const S3SI_VERSION = "0.4.17"; +export const NSOAPP_VERSION = "2.10.0"; +export const WEB_VIEW_VERSION = "6.0.0-2ba8cb04"; export enum Queries { HomeQuery = "51fc56bbf006caf37728914aa8bc0e2c86a80cf195b4d4027d6822a3623098a8",