]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
Fetch things in bulk for the homepage
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-video-playlist / video-playlist-element-miniature.component.ts
index 5879c49781354541ffa143be8c9a0f9b00c5280d..2e495ec266c7a95e8a472df0840947690f4b9195 100644 (file)
@@ -2,8 +2,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, In
 import { AuthService, Notifier, ServerService } from '@app/core'
 import { Video } from '@app/shared/shared-main'
 import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
-import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models'
-import { secondsToTime } from '../../../assets/player/utils'
+import { secondsToTime } from '@shared/core-utils'
+import { HTMLServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models'
 import { VideoPlaylistElement } from './video-playlist-element.model'
 import { VideoPlaylist } from './video-playlist.model'
 import { VideoPlaylistService } from './video-playlist.service'
@@ -37,7 +37,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
     stopTimestamp: number
   } = {} as any
 
-  private serverConfig: ServerConfig
+  private serverConfig: HTMLServerConfig
 
   constructor (
     private authService: AuthService,
@@ -48,12 +48,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
   ) {}
 
   ngOnInit (): void {
-    this.serverConfig = this.serverService.getTmpConfig()
-    this.serverService.getConfig()
-        .subscribe(config => {
-          this.serverConfig = config
-          this.cdr.detectChanges()
-        })
+    this.serverConfig = this.serverService.getHTMLConfig()
   }
 
   isUnavailable (e: VideoPlaylistElement) {
@@ -71,14 +66,14 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
   buildRouterLink () {
     if (!this.playlist) return null
 
-    return [ '/videos/watch/playlist', this.playlist.uuid ]
+    return VideoPlaylist.buildWatchUrl(this.playlist)
   }
 
   buildRouterQuery () {
     if (!this.playlistElement || !this.playlistElement.video) return {}
 
     return {
-      videoId: this.playlistElement.video.uuid,
+      playlistPosition: this.playlistElement.position,
       start: this.playlistElement.startTimestamp,
       stop: this.playlistElement.stopTimestamp,
       resume: true