Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 82eee0d

Browse files
committed
fixed big floats to string formatting
1 parent b94e0c2 commit 82eee0d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

MediaPlayParse - YouTube with SponsorBlock.as

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,6 +1968,11 @@ string PlayitemParse(const string &in path, dictionary &MetaData, array<dictiona
19681968

19691969
array<string> readableCats = {"Sponsor", "Self Promotion", "Interaction Reminder", "Intro", "Outro", "Preview", "No Music", "Non-essential Filler"};
19701970

1971+
dictionary firstItem;
1972+
firstItem["title"] = "Video";
1973+
firstItem["time"] = "0";
1974+
chapt.insertLast(firstItem);
1975+
19711976
for(int j = 0, len = root.size(); j < len; j++)
19721977
{
19731978
JsonValue chapter = root[j];
@@ -1979,12 +1984,12 @@ string PlayitemParse(const string &in path, dictionary &MetaData, array<dictiona
19791984
dictionary startItem;
19801985
int categoryId = int(typesToId[chapter["category"].asString()]);
19811986
startItem["title"] = "SB - " + readableCats[categoryId];
1982-
startItem["time"] = (segment[0].asFloat() * 1000) + "";
1987+
startItem["time"] = formatFloat((segment[0].asFloat() * 1000), "", 32, 0);
19831988
chapt.insertLast(startItem);
19841989

19851990
dictionary endItem;
19861991
endItem["title"] = "Video";
1987-
endItem["time"] = (segment[1].asFloat() * 1000) + "";
1992+
endItem["time"] = string("" + formatFloat((segment[1].asFloat() * 1000), "", 32, 0));
19881993
chapt.insertLast(endItem);
19891994
}
19901995
}

0 commit comments

Comments
 (0)