Skip to content

Commit 5aae3da

Browse files
Fix price calculation for info display
- Fix price calculation to use official_price when available, falling back to price
1 parent e3f7291 commit 5aae3da

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

build-rel.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off&cd /d %~dp0
22

33
set "ISCC_PATH=C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
4-
set VERSION_NUM=1.2.2
4+
set VERSION_NUM=1.2.3
55

66
mkdir build\asmr-dl-ng
77
xcopy bin build\asmr-dl-ng\bin /E /I /Q

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asmr-dl-ng",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "ASMR Direct Downloader (New Generation)",
55
"author": "daydreamer-json <[email protected]> (https://github.com/daydreamer-json)",
66
"license": "AGPL-3.0-or-later",

setup/main.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define MyAppName "asmr-dl-ng"
2-
#define MyAppVersion "1.2.2"
2+
#define MyAppVersion "1.2.3"
33
#define MyAppPublisher "daydreamer-json"
44
#define MyAppURL "https://github.com/daydreamer-json/asmr-dl-ng"
55
#define MyAppExeName "asmr-dl-ng.exe"

src/utils/configEmbed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import semver from 'semver';
22

33
export default {
44
APPLICATION_NAME: 'asmr-dl-ng',
5-
VERSION_NUMBER: semver.valid('1.2.2'),
5+
VERSION_NUMBER: semver.valid('1.2.3'),
66
};

src/utils/termPretty.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,16 @@ function printWorkInfo(workApiRsp: {
160160

161161
const tmpObj = {
162162
dlCount: workApiRsp.infoOrig.dl_count.toLocaleString(),
163-
price: workApiRsp.infoOrig.price.toLocaleString(),
164163
...(() => {
165-
const outPrice: number = (workApiRsp.infoOrig.price * 100) / (100 + configReadOnly.jpyTax);
164+
const rawApiPrice = workApiRsp.infoOrig.official_price ?? workApiRsp.infoOrig.price;
165+
const outPrice: number = (rawApiPrice * 100) / (100 + configReadOnly.jpyTax);
166166
const inputPrice: number =
167167
outPrice > configReadOnly.dlsitePriceTable.at(-1)?.output!
168168
? outPrice * 0.8
169169
: configReadOnly.dlsitePriceTable.find((e) => e.output === outPrice)!.input;
170170
const dlsiteFeePrice: number = outPrice - inputPrice;
171171
return {
172+
price: rawApiPrice.toLocaleString(),
172173
creatorEarn: (inputPrice * workApiRsp.infoOrig.dl_count).toLocaleString(),
173174
bizEarn: (dlsiteFeePrice * workApiRsp.infoOrig.dl_count).toLocaleString(),
174175
feePcnt: mathUtils.rounder('round', (dlsiteFeePrice / inputPrice) * 100, 1).orig.toString() + '%',

0 commit comments

Comments
 (0)