[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 5de6f21 377/389: Add msecs-to-timestamp as a common
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 5de6f21 377/389: Add msecs-to-timestamp as a common function |
Date: |
Fri, 3 Dec 2021 11:01:02 -0500 (EST) |
branch: elpa/subed
commit 5de6f21fb5c20b5098016c66d785c76c82994499
Author: Sacha Chua <sacha@sachachua.com>
Commit: Sacha Chua <sacha@sachachua.com>
Add msecs-to-timestamp as a common function
That way, calling it from a WebVTT file uses the right format.
* subed/subed.el (subed--generic-function-suffixes): Add
msecs-to-timestamp.
* tests/test-subed-srt.el ("Converting msecs to timestamp"):
Add test.
* tests/test-subed-vtt.el ("VTT"): Add test.
---
subed/subed.el | 1 +
tests/test-subed-srt.el | 4 ++++
tests/test-subed-vtt.el | 6 +++++-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/subed/subed.el b/subed/subed.el
index e148fe7..eb71b79 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -110,6 +110,7 @@
(list "subtitle-id" "subtitle-id-max" "subtitle-id-at-msecs"
"subtitle-msecs-start" "subtitle-msecs-stop"
"subtitle-text" "subtitle-relative-point"
+ "msecs-to-timestamp"
"jump-to-subtitle-id" "jump-to-subtitle-id-at-msecs"
"jump-to-subtitle-time-start" "jump-to-subtitle-time-stop"
"jump-to-subtitle-text" "jump-to-subtitle-text-at-msecs"
diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index e0d0203..e644721 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -1473,3 +1473,7 @@ Baz.
(expect (point) :to-equal 33)))
)
)
+(describe "Converting msecs to timestamp"
+ (it "uses the right format"
+ (with-temp-srt-buffer
+ (expect (subed-msecs-to-timestamp 1401) :to-equal "00:00:01,401"))))
diff --git a/tests/test-subed-vtt.el b/tests/test-subed-vtt.el
index 6c7261a..71b4de9 100644
--- a/tests/test-subed-vtt.el
+++ b/tests/test-subed-vtt.el
@@ -1133,4 +1133,8 @@ Baz.
(subed-vtt--sort)
(expect (point) :to-equal (1- (point-max)))))
)
- ))
+ )
+ (describe "Converting msecs to timestamp"
+ (it "uses the right format"
+ (with-temp-vtt-buffer
+ (expect (subed-msecs-to-timestamp 1401) :to-equal "00:00:01.401")))))
- [nongnu] elpa/subed d9c41ba 345/389: Add test for validation fix, (continued)
- [nongnu] elpa/subed d9c41ba 345/389: Add test for validation fix, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8bdec56 356/389: Move subed-split-subtitle to "Inserting" section, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed b28f528 364/389: Revert indentation changes, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5b868c3 366/389: Fix minor issues in README.org added in last commit, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6949622 365/389: Adopt REUSE standard for copyright and licensing, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9f55817 369/389: Wrap start/stop calculating functions in `ignore-errors', ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed beda7dc 371/389: Add functions to insert HTML-like tags, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed c23dd84 373/389: Add info about the new features to README.org, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6a5802c 374/389: Add video movement per frame, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 828764f 375/389: Change keybindings and use a transient keymap, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5de6f21 377/389: Add msecs-to-timestamp as a common function,
ELPA Syncer <=
- [nongnu] elpa/subed b42f563 378/389: Add audio extensions, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6b1a6f2 367/389: Add computing and displaying characters per second, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3ba295b 336/389: Fix "service name too long", ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 961e5eb 343/389: More subed-vtt fixes: require subed-vtt, validate better, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 87b3823 353/389: subed-split-subtitle works at the beginning or end of subtitle text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3b4b56a 384/389: Merge pull request #49 from sachac/fix-vtt-spaces, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bee9e63 342/389: subed-vtt: Fix syncing point with player, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 016c6a5 363/389: subed-split-subtitle: Handle more cases, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6164f88 380/389: Keep track of video being played, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 70561f0 381/389: Make hours optional in VTT files, following the spec, ELPA Syncer, 2021/12/03