Fix timestamp precision issue in plugin

This commit is contained in:
Alex Ling 2022-01-23 09:47:00 +00:00
parent 2c7c29fef9
commit cae832911d

View File

@ -300,7 +300,9 @@ class Plugin
end
def new_chapters(manga_id : String, after : Int64)
json = eval_json "newChapters('#{manga_id}', #{after})"
# Converting standard timestamp to milliseconds so plugins can easily do
# `new Date(ms_timestamp)` in JS.
json = eval_json "newChapters('#{manga_id}', #{after * 1000})"
begin
json.as_a.each do |obj|
assert_chapter_type obj