aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-26 08:37:26 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-07 08:28:14 +0200
commit583eb04b541175035d6d452ca626a96ebf2b7437 (patch)
tree114ba0a7004b4b2a7fc77444ef5fcb73414c6e93 /client/src/app/shared
parent4504f09f6e85f09b0489debb547a17209d7176ea (diff)
downloadPeerTube-583eb04b541175035d6d452ca626a96ebf2b7437.tar.gz
PeerTube-583eb04b541175035d6d452ca626a96ebf2b7437.tar.zst
PeerTube-583eb04b541175035d6d452ca626a96ebf2b7437.zip
Upgrade to angular 10
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-instance/instance-follow.service.ts2
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts6
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.ts3
-rw-r--r--client/src/app/shared/shared-moderation/server-blocklist.component.ts3
-rw-r--r--client/src/app/shared/shared-video-miniature/abstract-video-list.ts3
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.ts6
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.ts2
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts2
8 files changed, 15 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-instance/instance-follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts
index 3c9ccc40f..e52660140 100644
--- a/client/src/app/shared/shared-instance/instance-follow.service.ts
+++ b/client/src/app/shared/shared-instance/instance-follow.service.ts
@@ -4,7 +4,7 @@ import { catchError, map } from 'rxjs/operators'
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService } from '@app/core' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
7import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' 7import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/models'
8import { environment } from '../../../environments/environment' 8import { environment } from '../../../environments/environment'
9 9
10@Injectable() 10@Injectable()
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index ee3549695..edaefa9f2 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -1,4 +1,3 @@
1import { FfprobeData } from 'fluent-ffmpeg'
2import { Observable } from 'rxjs' 1import { Observable } from 'rxjs'
3import { catchError, map, switchMap } from 'rxjs/operators' 2import { catchError, map, switchMap } from 'rxjs/operators'
4import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' 3import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'
@@ -19,7 +18,8 @@ import {
19 VideoFilter, 18 VideoFilter,
20 VideoPrivacy, 19 VideoPrivacy,
21 VideoSortField, 20 VideoSortField,
22 VideoUpdate 21 VideoUpdate,
22 VideoFileMetadata
23} from '@shared/models' 23} from '@shared/models'
24import { environment } from '../../../../environments/environment' 24import { environment } from '../../../../environments/environment'
25import { Account, AccountService } from '../account' 25import { Account, AccountService } from '../account'
@@ -275,7 +275,7 @@ export class VideoService implements VideosProvider {
275 275
276 getVideoFileMetadata (metadataUrl: string) { 276 getVideoFileMetadata (metadataUrl: string) {
277 return this.authHttp 277 return this.authHttp
278 .get<FfprobeData>(metadataUrl) 278 .get<VideoFileMetadata>(metadataUrl)
279 .pipe( 279 .pipe(
280 catchError(err => this.restExtractor.handleError(err)) 280 catchError(err => this.restExtractor.handleError(err))
281 ) 281 )
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
index 38e0d0424..11e554978 100644
--- a/client/src/app/shared/shared-moderation/account-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
@@ -1,11 +1,12 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { OnInit } from '@angular/core' 2import { OnInit, Directive } from '@angular/core'
3import { Notifier, RestPagination, RestTable } from '@app/core' 3import { Notifier, RestPagination, RestTable } from '@app/core'
4import { Actor } from '@app/shared/shared-main' 4import { Actor } from '@app/shared/shared-main'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { AccountBlock } from './account-block.model' 6import { AccountBlock } from './account-block.model'
7import { BlocklistComponentType, BlocklistService } from './blocklist.service' 7import { BlocklistComponentType, BlocklistService } from './blocklist.service'
8 8
9@Directive()
9export class GenericAccountBlocklistComponent extends RestTable implements OnInit { 10export class GenericAccountBlocklistComponent extends RestTable implements OnInit {
10 // @ts-ignore: "Abstract methods can only appear within an abstract class" 11 // @ts-ignore: "Abstract methods can only appear within an abstract class"
11 abstract mode: BlocklistComponentType 12 abstract mode: BlocklistComponentType
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
index d904d0605..694b03762 100644
--- a/client/src/app/shared/shared-moderation/server-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
@@ -1,11 +1,12 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { OnInit, ViewChild } from '@angular/core' 2import { OnInit, ViewChild, Directive } from '@angular/core'
3import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component' 3import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component'
4import { Notifier, RestPagination, RestTable } from '@app/core' 4import { Notifier, RestPagination, RestTable } from '@app/core'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ServerBlock } from '@shared/models' 6import { ServerBlock } from '@shared/models'
7import { BlocklistComponentType, BlocklistService } from './blocklist.service' 7import { BlocklistComponentType, BlocklistService } from './blocklist.service'
8 8
9@Directive()
9export class GenericServerBlocklistComponent extends RestTable implements OnInit { 10export class GenericServerBlocklistComponent extends RestTable implements OnInit {
10 @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent 11 @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent
11 12
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
index 0ef842652..405af5fa6 100644
--- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
+++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
@@ -1,6 +1,6 @@
1import { fromEvent, Observable, Subject, Subscription } from 'rxjs' 1import { fromEvent, Observable, Subject, Subscription } from 'rxjs'
2import { debounceTime, switchMap, tap } from 'rxjs/operators' 2import { debounceTime, switchMap, tap } from 'rxjs/operators'
3import { OnDestroy, OnInit } from '@angular/core' 3import { OnDestroy, OnInit, Directive } from '@angular/core'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { 5import {
6 AuthService, 6 AuthService,
@@ -30,6 +30,7 @@ enum GroupDate {
30 OLDER = 5 30 OLDER = 5
31} 31}
32 32
33@Directive()
33export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableForReuseHook { 34export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableForReuseHook {
34 pagination: ComponentPaginationLight = { 35 pagination: ComponentPaginationLight = {
35 currentPage: 1, 36 currentPage: 1,
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts
index 21df8b674..4fd06eacf 100644
--- a/client/src/app/shared/shared-video-miniature/video-download.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts
@@ -1,4 +1,3 @@
1import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg'
2import { mapValues, pick } from 'lodash-es' 1import { mapValues, pick } from 'lodash-es'
3import { BytesPipe } from 'ngx-pipes' 2import { BytesPipe } from 'ngx-pipes'
4import { Component, ElementRef, ViewChild } from '@angular/core' 3import { Component, ElementRef, ViewChild } from '@angular/core'
@@ -144,7 +143,7 @@ export class VideoDownloadComponent {
144 this.type = type 143 this.type = type
145 } 144 }
146 145
147 getMetadataFormat (format: FfprobeFormat) { 146 getMetadataFormat (format: any) {
148 const keyToTranslateFunction = { 147 const keyToTranslateFunction = {
149 'encoder': (value: string) => ({ label: this.i18n('Encoder'), value }), 148 'encoder': (value: string) => ({ label: this.i18n('Encoder'), value }),
150 'format_long_name': (value: string) => ({ label: this.i18n('Format name'), value }), 149 'format_long_name': (value: string) => ({ label: this.i18n('Format name'), value }),
@@ -165,7 +164,7 @@ export class VideoDownloadComponent {
165 ) 164 )
166 } 165 }
167 166
168 getMetadataStream (streams: FfprobeStream[], type: 'video' | 'audio') { 167 getMetadataStream (streams: any[], type: 'video' | 'audio') {
169 const stream = streams.find(s => s.codec_type === type) 168 const stream = streams.find(s => s.codec_type === type)
170 if (!stream) return undefined 169 if (!stream) return undefined
171 170
@@ -201,6 +200,7 @@ export class VideoDownloadComponent {
201 private hydrateMetadataFromMetadataUrl (file: VideoFile) { 200 private hydrateMetadataFromMetadataUrl (file: VideoFile) {
202 const observable = this.videoService.getVideoFileMetadata(file.metadataUrl) 201 const observable = this.videoService.getVideoFileMetadata(file.metadataUrl)
203 observable.subscribe(res => file.metadata = res) 202 observable.subscribe(res => file.metadata = res)
203
204 return observable.toPromise() 204 return observable.toPromise()
205 } 205 }
206} 206}
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
index f434550dd..3c7046de5 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
@@ -12,7 +12,7 @@ import {
12} from '@angular/core' 12} from '@angular/core'
13import { AuthService, ScreenService, ServerService, User } from '@app/core' 13import { AuthService, ScreenService, ServerService, User } from '@app/core'
14import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
15import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared' 15import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models'
16import { Video } from '../shared-main' 16import { Video } from '../shared-main'
17import { VideoPlaylistService } from '../shared-video-playlist' 17import { VideoPlaylistService } from '../shared-video-playlist'
18import { VideoActionsDisplayType } from './video-actions-dropdown.component' 18import { VideoActionsDisplayType } from './video-actions-dropdown.component'
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
index 27a79d1fd..f25f10ede 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
@@ -1,5 +1,5 @@
1import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos'
2import { Video } from '@app/shared/shared-main' 1import { Video } from '@app/shared/shared-main'
2import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '@shared/models'
3 3
4export class VideoPlaylistElement implements ServerVideoPlaylistElement { 4export class VideoPlaylistElement implements ServerVideoPlaylistElement {
5 id: number 5 id: number