Skip to content

Commit 60f2ca2

Browse files
committed
1.4.8 fixed
1 parent 0565773 commit 60f2ca2

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

src/renderer/components/app/etc/ProgressStepper.tsx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,48 @@ export default function ProgressStepper({
5656
return valueC;
5757
};
5858

59+
const getEpisodeOrChapterNumberBuffer = (
60+
value: any,
61+
valueC: any,
62+
type: any,
63+
progress: any,
64+
nextAiringEpisode: any,
65+
) => {
66+
if (type === 'ANIME') {
67+
if (value === null) {
68+
const num = Math.ceil(progress / 13);
69+
if (nextAiringEpisode === null && value === null) {
70+
return 0;
71+
}
72+
if (progress >= 1000) {
73+
return 9999;
74+
}
75+
if (progress >= 100) {
76+
return 999;
77+
}
78+
if (progress === 0) {
79+
return 13;
80+
}
81+
return num * 13 + 1;
82+
}
83+
return value;
84+
}
85+
if (valueC === null) {
86+
const num = Math.ceil(progress / 26);
87+
if (progress >= 1000) {
88+
return 9999;
89+
}
90+
if (progress >= 100) {
91+
return 999;
92+
}
93+
if (progress === 0) {
94+
return 13;
95+
}
96+
return num * 26 + 1;
97+
}
98+
return valueC;
99+
};
100+
59101
const normalise = (value: number, valueC: number, type: any) => {
60102
if (type === 'ANIME') {
61103
return (
@@ -189,11 +231,12 @@ export default function ProgressStepper({
189231
buffer={normalise(
190232
props.nextAiringEpisode !== null
191233
? props.nextAiringEpisode.episode - 1
192-
: getEpisodeOrChapterNumber(
234+
: getEpisodeOrChapterNumberBuffer(
193235
props.episodes,
194236
props.chapters,
195237
props.type,
196238
advancedInput.progress,
239+
props.nextAiringEpisode,
197240
), // this should be episodes or if episodes is null, then default number
198241
props.chapters,
199242
props.type,

0 commit comments

Comments
 (0)