Skip to content

Commit

Permalink
Add a duration property for the HelixClip class (#321)
Browse files Browse the repository at this point in the history
* Add a duration property for the HelixClip class

* Fix comment consistency
  • Loading branch information
CaveMobster committed Jan 17, 2022
1 parent 922c5f6 commit 44f77ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/api/src/api/helix/clip/HelixClip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface HelixClipData {
view_count: number;
created_at: string;
thumbnail_url: string;
duration: number;
}

@rtfm<HelixClip>('api', 'HelixClip', 'id')
Expand Down Expand Up @@ -158,4 +159,11 @@ export class HelixClip extends DataObject<HelixClipData> {
get thumbnailUrl(): string {
return this[rawDataSymbol].thumbnail_url;
}

/**
* The duration of the clip in seconds (up to 0.1 precision).
*/
get duration(): number {
return this[rawDataSymbol].duration;
}
}

0 comments on commit 44f77ea

Please sign in to comment.