aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
blob: b661378bd80b51238816a4ec2f1e3775b4529a29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Video } from '@app/shared/shared-main'
import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '@shared/models'

export class VideoPlaylistElement implements ServerVideoPlaylistElement {
  id: number
  position: number
  startTimestamp: number
  stopTimestamp: number

  type: VideoPlaylistElementType

  video?: Video

  constructor (hash: ServerVideoPlaylistElement, translations: { [ id: string ]: string } = {}) {
    this.id = hash.id
    this.position = hash.position
    this.startTimestamp = hash.startTimestamp
    this.stopTimestamp = hash.stopTimestamp

    this.type = hash.type

    if (hash.video) this.video = new Video(hash.video, translations)
  }
}