Skip to content

Commit

Permalink
added constructor with duration argument and make it compatible with …
Browse files Browse the repository at this point in the history
…chaptertool again
  • Loading branch information
Mtillmann committed Mar 9, 2024
1 parent fabe2a3 commit da8c843
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mtillmann/chapters",
"version": "0.0.3",
"version": "0.1.0",
"description": "library that manages and converts chapters of multiple formats",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ const vtt2 = Autoformat.as(WebVTT, webVttString) // returns an instance of WebVT

All formats support the following methods:

### `constructor (duration: number = 3600)`

Creates a new instance of the class, optionally with a duration in seconds.

### `static create (input?: string | MediaItem): MediaItem`

Creates a new media item. This is the suggested way to create a media item:
Expand Down
3 changes: 0 additions & 3 deletions src/Formats/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export abstract class Base implements MediaItem {
this.duration = chapter.startTime
}
}
if (this.duration === 0) {
this.duration = 3600
}

this.bump()
return this
Expand Down

0 comments on commit da8c843

Please sign in to comment.