]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video-import/video-import.service.ts
Lazy load static objects
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video-import / video-import.service.ts
index fc34dbf2d33ca748f3273f23484283eac4aba5c8..3e3fb7dfb42aeb6a60287e773da51d0f79b2058d 100644 (file)
@@ -2,7 +2,7 @@ import { catchError, map, switchMap } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { Observable } from 'rxjs'
-import { VideoImport } from '../../../../../shared'
+import { peertubeTranslate, VideoImport } from '../../../../../shared'
 import { environment } from '../../../environments/environment'
 import { RestExtractor, RestService } from '../rest'
 import { VideoImportCreate, VideoUpdate } from '../../../../../shared/models/videos'
@@ -12,7 +12,6 @@ import { UserService } from '@app/shared/users/user.service'
 import { SortMeta } from 'primeng/components/common/sortmeta'
 import { RestPagination } from '@app/shared/rest'
 import { ServerService } from '@app/core'
-import { peertubeTranslate } from '@app/shared/i18n/i18n-utils'
 
 @Injectable()
 export class VideoImportService {
@@ -68,6 +67,7 @@ export class VideoImportService {
     const description = video.description || null
     const support = video.support || null
     const scheduleUpdate = video.scheduleUpdate || null
+    const originallyPublishedAt = video.originallyPublishedAt || null
 
     return {
       name: video.name,
@@ -82,14 +82,16 @@ export class VideoImportService {
       nsfw: video.nsfw,
       waitTranscoding: video.waitTranscoding,
       commentsEnabled: video.commentsEnabled,
+      downloadEnabled: video.downloadEnabled,
       thumbnailfile: video.thumbnailfile,
       previewfile: video.previewfile,
-      scheduleUpdate
+      scheduleUpdate,
+      originallyPublishedAt
     }
   }
 
   private extractVideoImports (result: ResultList<VideoImport>): Observable<ResultList<VideoImport>> {
-    return this.serverService.localeObservable
+    return this.serverService.getServerLocale()
                .pipe(
                  map(translations => {
                    result.data.forEach(d =>