From 338e87ce37d83f9775a13f13a6d8f4e8482ffe79 Mon Sep 17 00:00:00 2001 From: Song Xie Date: Mon, 14 Feb 2022 17:58:39 -0800 Subject: [PATCH] Fix Danmaku ass timestamp when it's greater than 1 hour When the timestamp in ass is greater than 1 hour, there's a bug that the minute part can exceed 59, which is caused by it's not mod by 60. This 1-liner PR should fix it. But since the original project doesn't have build scripts, I'm not able to verify it locally. --- src/Core/danmaku2ass/Utils.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Core/danmaku2ass/Utils.cs b/src/Core/danmaku2ass/Utils.cs index 583cc89..0bf6d2d 100644 --- a/src/Core/danmaku2ass/Utils.cs +++ b/src/Core/danmaku2ass/Utils.cs @@ -62,6 +62,7 @@ namespace Core.danmaku2ass int second = (int)(i % 60.0f); int hour = (int)Math.Floor(min / 60.0); + min %= 60; return $"{hour:D}:{min:D2}:{second:D2}.{dec:D2}"; }