diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/shared/shared-main/video-channel | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/shared/shared-main/video-channel')
-rw-r--r-- | client/src/app/shared/shared-main/video-channel/video-channel.model.ts | 5 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/video-channel/video-channel.service.ts | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts index a9dcf2fa2..66d4cac68 100644 --- a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { getAbsoluteAPIUrl } from '@app/helpers' | 1 | import { getAbsoluteAPIUrl } from '@app/helpers' |
2 | import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models' | 2 | import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models' |
3 | import { Account } from '../account/account.model' | ||
4 | import { Actor } from '../account/actor.model' | 3 | import { Actor } from '../account/actor.model' |
5 | 4 | ||
6 | export class VideoChannel extends Actor implements ServerVideoChannel { | 5 | export class VideoChannel extends Actor implements ServerVideoChannel { |
@@ -25,14 +24,14 @@ export class VideoChannel extends Actor implements ServerVideoChannel { | |||
25 | 24 | ||
26 | viewsPerDay?: ViewsPerDate[] | 25 | viewsPerDay?: ViewsPerDate[] |
27 | 26 | ||
28 | static GET_ACTOR_AVATAR_URL (actor: object) { | 27 | static GET_ACTOR_AVATAR_URL (actor: { avatar?: { url?: string, path: string } }) { |
29 | return Actor.GET_ACTOR_AVATAR_URL(actor) | 28 | return Actor.GET_ACTOR_AVATAR_URL(actor) |
30 | } | 29 | } |
31 | 30 | ||
32 | static GET_ACTOR_BANNER_URL (channel: ServerVideoChannel) { | 31 | static GET_ACTOR_BANNER_URL (channel: ServerVideoChannel) { |
33 | if (channel?.banner?.url) return channel.banner.url | 32 | if (channel?.banner?.url) return channel.banner.url |
34 | 33 | ||
35 | if (channel && channel.banner) { | 34 | if (channel?.banner) { |
36 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 35 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
37 | 36 | ||
38 | return absoluteAPIUrl + channel.banner.path | 37 | return absoluteAPIUrl + channel.banner.path |
diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts index a89f1065a..7560a35a8 100644 --- a/client/src/app/shared/shared-main/video-channel/video-channel.service.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts | |||
@@ -15,6 +15,12 @@ export class VideoChannelService { | |||
15 | 15 | ||
16 | videoChannelLoaded = new ReplaySubject<VideoChannel>(1) | 16 | videoChannelLoaded = new ReplaySubject<VideoChannel>(1) |
17 | 17 | ||
18 | constructor ( | ||
19 | private authHttp: HttpClient, | ||
20 | private restService: RestService, | ||
21 | private restExtractor: RestExtractor | ||
22 | ) { } | ||
23 | |||
18 | static extractVideoChannels (result: ResultList<VideoChannelServer>) { | 24 | static extractVideoChannels (result: ResultList<VideoChannelServer>) { |
19 | const videoChannels: VideoChannel[] = [] | 25 | const videoChannels: VideoChannel[] = [] |
20 | 26 | ||
@@ -25,12 +31,6 @@ export class VideoChannelService { | |||
25 | return { data: videoChannels, total: result.total } | 31 | return { data: videoChannels, total: result.total } |
26 | } | 32 | } |
27 | 33 | ||
28 | constructor ( | ||
29 | private authHttp: HttpClient, | ||
30 | private restService: RestService, | ||
31 | private restExtractor: RestExtractor | ||
32 | ) { } | ||
33 | |||
34 | getVideoChannel (videoChannelName: string) { | 34 | getVideoChannel (videoChannelName: string) { |
35 | return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName) | 35 | return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName) |
36 | .pipe( | 36 | .pipe( |