Skip to content

Commit

Permalink
added constructor with duration argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Mtillmann committed Mar 9, 2024
1 parent 8c472b4 commit fabe2a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Formats/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ export abstract class Base implements MediaItem {

isChapterFormat: boolean = true

static create (input?: string | MediaItem): MediaItem {
constructor (duration: number = 3600) {
this.duration = duration
}

static create (input?: string | MediaItem, duration?: number): MediaItem {
// @ts-expect-error: this will be the final class
return (new this()).from(input)
return (new this(duration)).from(input)
}

from (input?: string | MediaItem): MediaItem {
Expand Down

0 comments on commit fabe2a3

Please sign in to comment.