From 67ed6552b831df66713bac9e672738796128d33f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:10:17 +0200 Subject: Reorganize client shared modules --- .../app/shared/video/video-thumbnail.component.ts | 63 ---------------------- 1 file changed, 63 deletions(-) delete mode 100644 client/src/app/shared/video/video-thumbnail.component.ts (limited to 'client/src/app/shared/video/video-thumbnail.component.ts') diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/video/video-thumbnail.component.ts deleted file mode 100644 index 111b4c8bb..000000000 --- a/client/src/app/shared/video/video-thumbnail.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core' -import { Video } from './video.model' -import { ScreenService } from '@app/shared/misc/screen.service' -import { I18n } from '@ngx-translate/i18n-polyfill' - -@Component({ - selector: 'my-video-thumbnail', - styleUrls: [ './video-thumbnail.component.scss' ], - templateUrl: './video-thumbnail.component.html' -}) -export class VideoThumbnailComponent { - @Input() video: Video - @Input() nsfw = false - @Input() routerLink: any[] - @Input() queryParams: { [ p: string ]: any } - - @Input() displayWatchLaterPlaylist: boolean - @Input() inWatchLaterPlaylist: boolean - - @Output() watchLaterClick = new EventEmitter() - - addToWatchLaterText: string - addedToWatchLaterText: string - - constructor ( - private screenService: ScreenService, - private i18n: I18n - ) { - this.addToWatchLaterText = this.i18n('Add to watch later') - this.addedToWatchLaterText = this.i18n('Remove from watch later') - } - - getImageUrl () { - if (!this.video) return '' - - if (this.screenService.isInMobileView()) { - return this.video.previewUrl - } - - return this.video.thumbnailUrl - } - - getProgressPercent () { - if (!this.video.userHistory) return 0 - - const currentTime = this.video.userHistory.currentTime - - return (currentTime / this.video.duration) * 100 - } - - getVideoRouterLink () { - if (this.routerLink) return this.routerLink - - return [ '/videos/watch', this.video.uuid ] - } - - onWatchLaterClick (event: Event) { - this.watchLaterClick.emit(this.inWatchLaterPlaylist) - - event.stopPropagation() - return false - } -} -- cgit v1.2.3