-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump version to 0.1.3, update MKVMergeXML to handle timestamp precisi…
…on, and add tests for chaptertool issue #18
- Loading branch information
Showing
5 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import {readFileSync} from "fs"; | ||
import {sep} from "path"; | ||
import {MKVMergeXML} from "../src/Formats/MKVMergeXML"; | ||
|
||
describe('MKVMergeXML Format Handler --- chaptertool issue #18', () => { | ||
|
||
|
||
const content = readFileSync(module.path + sep + 'samples' + sep + 'mkvmerge-chaptertool-issue-18.xml', 'utf-8'); | ||
|
||
it('parses well-formed input', () => { | ||
expect(() => { | ||
MKVMergeXML.create(content); | ||
}).not.toThrow(Error); | ||
}); | ||
|
||
const instance = MKVMergeXML.create(content); | ||
|
||
it('has the correct number of chapters from content', () => { | ||
expect(instance.chapters.length).toEqual(10); | ||
}); | ||
|
||
it('has parsed the timestamps correctly', () => { | ||
expect(instance.chapters[1].startTime).toBe(600.516) | ||
}); | ||
|
||
|
||
it('has parsed the chapter titles correctly', () => { | ||
expect(instance.chapters[1].title).toBe('Chapter 02') | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd"> --> | ||
<Chapters> | ||
<EditionEntry> | ||
<EditionUID>18199911203212776794</EditionUID> | ||
<EditionFlagHidden>0</EditionFlagHidden> | ||
<EditionFlagDefault>1</EditionFlagDefault> | ||
<ChapterAtom> | ||
<ChapterUID>967610324052188741</ChapterUID> | ||
<ChapterTimeStart>00:00:00.000000000</ChapterTimeStart> | ||
<ChapterTimeEnd>00:10:00.516583333</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 01</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>9982692933481321716</ChapterUID> | ||
<ChapterTimeStart>00:10:00.516583333</ChapterTimeStart> | ||
<ChapterTimeEnd>00:20:01.658791666</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 02</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>10100638270006970476</ChapterUID> | ||
<ChapterTimeStart>00:20:01.658791666</ChapterTimeStart> | ||
<ChapterTimeEnd>00:30:22.070250000</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 03</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>7618622075668223579</ChapterUID> | ||
<ChapterTimeStart>00:30:22.070250000</ChapterTimeStart> | ||
<ChapterTimeEnd>00:40:02.149750000</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 04</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>2970456447067052416</ChapterUID> | ||
<ChapterTimeStart>00:40:02.149750000</ChapterTimeStart> | ||
<ChapterTimeEnd>00:50:02.666333333</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 05</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>4580233962780638856</ChapterUID> | ||
<ChapterTimeStart>00:50:02.666333333</ChapterTimeStart> | ||
<ChapterTimeEnd>01:00:03.474875000</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 06</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>12392132750035924820</ChapterUID> | ||
<ChapterTimeStart>01:00:03.474875000</ChapterTimeStart> | ||
<ChapterTimeEnd>01:10:03.824625000</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 07</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>4981921100376706990</ChapterUID> | ||
<ChapterTimeStart>01:10:03.824625000</ChapterTimeStart> | ||
<ChapterTimeEnd>01:20:04.424625000</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 08</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>8971296671021847156</ChapterUID> | ||
<ChapterTimeStart>01:20:04.424625000</ChapterTimeStart> | ||
<ChapterTimeEnd>01:30:05.483416666</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 09</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
<ChapterAtom> | ||
<ChapterUID>938349414182508344</ChapterUID> | ||
<ChapterTimeStart>01:30:05.483416666</ChapterTimeStart> | ||
<ChapterTimeEnd>01:35:01.987958333</ChapterTimeEnd> | ||
<ChapterFlagHidden>0</ChapterFlagHidden> | ||
<ChapterFlagEnabled>1</ChapterFlagEnabled> | ||
<ChapterDisplay> | ||
<ChapterString>Chapter 10</ChapterString> | ||
<ChapterLanguage>eng</ChapterLanguage> | ||
</ChapterDisplay> | ||
</ChapterAtom> | ||
</EditionEntry> | ||
</Chapters> |