From f479685678406a5df864d89615b33d29085ebfc6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Apr 2021 11:35:56 +0200 Subject: Agnostic actor image storage --- client/src/app/shared/shared-main/account/account.model.ts | 4 ++-- client/src/app/shared/shared-main/account/actor.model.ts | 4 ++-- .../src/app/shared/shared-main/video-channel/video-channel.model.ts | 4 ++-- .../app/shared/shared-main/video-channel/video-channel.service.ts | 4 ++-- client/src/app/shared/shared-main/video/video.model.ts | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.ts index b71a893d1..17fddff09 100644 --- a/client/src/app/shared/shared-main/account/account.model.ts +++ b/client/src/app/shared/shared-main/account/account.model.ts @@ -1,4 +1,4 @@ -import { Account as ServerAccount, Avatar } from '@shared/models' +import { Account as ServerAccount, ActorImage } from '@shared/models' import { Actor } from './actor.model' export class Account extends Actor implements ServerAccount { @@ -38,7 +38,7 @@ export class Account extends Actor implements ServerAccount { this.mutedServerByInstance = false } - updateAvatar (newAvatar: Avatar) { + updateAvatar (newAvatar: ActorImage) { this.avatar = newAvatar this.updateComputedAttributes() diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index 8222c9769..c105a88ac 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts @@ -1,4 +1,4 @@ -import { Actor as ActorServer, Avatar } from '@shared/models' +import { Actor as ActorServer, ActorImage } from '@shared/models' import { getAbsoluteAPIUrl } from '@app/helpers' export abstract class Actor implements ActorServer { @@ -10,7 +10,7 @@ export abstract class Actor implements ActorServer { followersCount: number createdAt: Date | string updatedAt: Date | string - avatar: Avatar + avatar: ActorImage avatarUrl: string 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 126e43cea..b4c3365a9 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,4 +1,4 @@ -import { Account as ServerAccount, Avatar, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models' +import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@shared/models' import { Account } from '../account/account.model' import { Actor } from '../account/actor.model' @@ -51,7 +51,7 @@ export class VideoChannel extends Actor implements ServerVideoChannel { } } - updateAvatar (newAvatar: Avatar) { + updateAvatar (newAvatar: ActorImage) { this.avatar = newAvatar this.updateComputedAttributes() 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 eff3fad4d..3f9ef74fa 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 @@ -3,7 +3,7 @@ import { catchError, map, tap } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' -import { Avatar, ResultList, VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' +import { ActorImage, ResultList, VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' import { environment } from '../../../../environments/environment' import { Account } from '../account' import { AccountService } from '../account/account.service' @@ -85,7 +85,7 @@ export class VideoChannelService { changeVideoChannelAvatar (videoChannelName: string, avatarForm: FormData) { const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelName + '/avatar/pick' - return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm) + return this.authHttp.post<{ avatar: ActorImage }>(url, avatarForm) .pipe(catchError(err => this.restExtractor.handleError(err))) } diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index adb6e884f..1c2c4a575 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -6,7 +6,7 @@ import { Actor } from '@app/shared/shared-main/account/actor.model' import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model' import { peertubeTranslate } from '@shared/core-utils/i18n' import { - Avatar, + ActorImage, ServerConfig, UserRight, Video as VideoServerModel, @@ -72,7 +72,7 @@ export class Video implements VideoServerModel { displayName: string url: string host: string - avatar?: Avatar + avatar?: ActorImage } channel: { @@ -81,7 +81,7 @@ export class Video implements VideoServerModel { displayName: string url: string host: string - avatar?: Avatar + avatar?: ActorImage } userHistory?: { -- cgit v1.2.3