diff --git a/README.md b/README.md index 2e8a3ef..082f595 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,16 @@ Export your battles from SplatNet to stat.ink 2. Run `deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts` +``` +Options: + --profile-path , -p Path to config file (default: ./profile.json) + --exporter , -e Exporter list to use (default: stat.ink) + Multiple exporters can be separated by commas + (e.g. "stat.ink,file") + --no-progress, -n Disable progress bar + --help Show this help message and exit +``` + ## Credits - https://github.com/frozenpandaman/s3s diff --git a/constant.ts b/constant.ts index 40a492e..90ab5c3 100644 --- a/constant.ts +++ b/constant.ts @@ -1,7 +1,7 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts"; export const AGENT_NAME = "s3si.ts"; -export const S3SI_VERSION = "0.1.1"; +export const S3SI_VERSION = "0.1.2"; export const NSOAPP_VERSION = "2.3.1"; export const WEB_VIEW_VERSION = "1.0.0-216d0219"; diff --git a/exporter/stat.ink.ts b/exporter/stat.ink.ts index 65f4338..b39d1fd 100644 --- a/exporter/stat.ink.ts +++ b/exporter/stat.ink.ts @@ -164,8 +164,7 @@ export class StatInkExporter implements BattleExporter { return result; } async mapBattle( - { lastInChallenge, bankaraMatchChallenge, listNode, detail: vsDetail }: - VsBattle, + { bankaraMatchChallenge, listNode, detail: vsDetail }: VsBattle, ): Promise { const { knockout, @@ -257,12 +256,10 @@ export class StatInkExporter implements BattleExporter { result.rank_after = result.rank_before; result.rank_after_s_plus = result.rank_before_s_plus; } - if (lastInChallenge) { - result.challenge_win = bankaraMatchChallenge.winCount; - result.challenge_lose = bankaraMatchChallenge.loseCount; - result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ?? - undefined; - } + result.challenge_win = bankaraMatchChallenge.winCount; + result.challenge_lose = bankaraMatchChallenge.loseCount; + result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ?? + undefined; } return result; diff --git a/s3si.ts b/s3si.ts index 9224280..f658e69 100644 --- a/s3si.ts +++ b/s3si.ts @@ -86,20 +86,16 @@ class BattleFetcher { return { bankaraMatchChallenge: null, listNode: null, - lastInChallenge: null, }; } const { bankaraMatchChallenge } = group; const listNode = group.historyDetails.nodes.find((i) => i._bid === bid) ?? null; - const idx = group.historyDetails.nodes.indexOf(listNode!); return { bankaraMatchChallenge, listNode, - lastInChallenge: (bankaraMatchChallenge?.state !== "INPROGRESS") && - (idx === 0), }; } async getBattleDetail(id: string): Promise { @@ -143,7 +139,7 @@ class App { constructor(public opts: Opts) { if (this.opts.help) { console.log( - `Usage: deno run --allow-net --allow-read --allow-write ${Deno.mainModule} [options] + `Usage: deno run -A ${Deno.mainModule} [options] Options: --profile-path , -p Path to config file (default: ./profile.json) diff --git a/types.ts b/types.ts index b0af56a..4590dff 100644 --- a/types.ts +++ b/types.ts @@ -93,7 +93,6 @@ export type VsRule = export type VsBattle = { listNode: null | BattleListNode; bankaraMatchChallenge: null | BankaraMatchChallenge; - lastInChallenge: null | boolean; detail: VsHistoryDetail; }; export type VsHistoryDetail = {