Compare commits

...

2 Commits

Author SHA1 Message Date
Rosalina 94fb731fe0
use splashcat exporter when set using cli flags 2024-01-14 02:48:38 -05:00
Rosalina cb0df39102
update readme and cli help 2024-01-14 02:48:07 -05:00
4 changed files with 34 additions and 4 deletions

View File

@ -3,7 +3,7 @@
[![Build status](https://github.com/spacemeowx2/s3si.ts/workflows/Build/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml)
[![Constant check status](https://github.com/spacemeowx2/s3si.ts/workflows/Constant%20Check/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml)
Export your battles from SplatNet to stat.ink.
Export your battles from SplatNet to stat.ink and Splashcat.
If you have used s3s, please see [here](#migrate-from-s3s).
@ -19,7 +19,7 @@ Options:
--profile-path <path>, -p Path to config file (default: ./profile.json)
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
Multiple exporters can be separated by commas
(e.g. "stat.ink,file")
(e.g. "stat.ink,file,splashcat")
--list-method When set to "latest", the latest 50 matches will be obtained.
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
@ -38,6 +38,10 @@ Options:
- If you want to use a different profile, use `-p` to specify the path to the
profile file.
### Splashcat Notes
Due to limitations with SplatNet 3 data, Splashcat requires battles uploaded to use `en-US` (set with `userLang`). Splashcat will localize most parts of battle results into the user's language when displayed.
### Track your rank
- Run
@ -71,7 +75,8 @@ Options:
// userLang will effect the language of the exported games to stat.ink
"userLang": "zh-CN",
"userCountry": "JP",
"statInkApiKey": "..."
"statInkApiKey": "...",
"splashcatApiKey": "..."
}
```

View File

@ -29,7 +29,7 @@ Options:
--profile-path <path>, -p Path to config file (default: ./profile.json)
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
Multiple exporters can be separated by commas
(e.g. "stat.ink,file")
(e.g. "stat.ink,file,splashcat")
--list-method When set to "latest", the latest 50 matches will be obtained.
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.

View File

@ -9,6 +9,7 @@ import { FileExporter } from "./exporters/file.ts";
import { delay, showError } from "./utils.ts";
import { GameFetcher } from "./GameFetcher.ts";
import { DEFAULT_ENV, Env } from "./env.ts";
import { SplashcatExporter } from "./exporters/splashcat.ts";
export type Opts = {
profilePath: string;
@ -220,6 +221,29 @@ export class App {
out.push(new FileExporter(state.fileExportPath));
}
if (exporters.includes("splashcat")) {
if (!state.splashcatApiKey) {
const key = (await this.env.prompts.prompt(
"Splashcat API key is not set. Please enter below.",
)).trim();
if (!key) {
this.env.logger.error("API key is required.");
Deno.exit(1);
}
await this.profile.writeState({
...state,
splashcatApiKey: key,
});
}
out.push(
new SplashcatExporter({
splashcatApiKey: this.profile.state.splashcatApiKey!,
uploadMode: this.opts.monitor ? "Monitoring" : "Manual",
env: this.env,
}),
);
}
return out;
}
exporterProgress(title: string) {

View File

@ -30,6 +30,7 @@ export type State = {
statInkApiKey?: string;
fileExportPath: string;
monitorInterval: number;
splashcatApiKey?: string;
};
export const DEFAULT_STATE: State = {