Add new default different avatar for channel and account
This commit is contained in:
parent
18490b0765
commit
c418d48300
|
@ -2,7 +2,7 @@ import { SortMeta } from 'primeng/api'
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core'
|
import { Component, OnInit, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router'
|
import { ActivatedRoute, Params, Router } from '@angular/router'
|
||||||
import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core'
|
import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core'
|
||||||
import { Actor, DropdownAction } from '@app/shared/shared-main'
|
import { Account, DropdownAction } from '@app/shared/shared-main'
|
||||||
import { UserBanModalComponent } from '@app/shared/shared-moderation'
|
import { UserBanModalComponent } from '@app/shared/shared-moderation'
|
||||||
import { ServerConfig, User, UserRole } from '@shared/models'
|
import { ServerConfig, User, UserRole } from '@shared/models'
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ export class UserListComponent extends RestTable implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
async unbanUsers (users: User[]) {
|
async unbanUsers (users: User[]) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SortMeta } from 'primeng/api'
|
import { SortMeta } from 'primeng/api'
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core'
|
import { Component, OnInit, ViewChild } from '@angular/core'
|
||||||
import { Notifier, RestPagination, RestTable } from '@app/core'
|
import { Notifier, RestPagination, RestTable } from '@app/core'
|
||||||
import { Account, Actor, VideoOwnershipService } from '@app/shared/shared-main'
|
import { Account, VideoOwnershipService } from '@app/shared/shared-main'
|
||||||
import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '@shared/models'
|
import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '@shared/models'
|
||||||
import { MyAcceptOwnershipComponent } from './my-accept-ownership/my-accept-ownership.component'
|
import { MyAcceptOwnershipComponent } from './my-accept-ownership/my-accept-ownership.component'
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export class MyOwnershipComponent extends RestTable implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
openAcceptModal (videoChangeOwnership: VideoChangeOwnership) {
|
openAcceptModal (videoChangeOwnership: VideoChangeOwnership) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Router } from '@angular/router'
|
||||||
import { Notifier, User } from '@app/core'
|
import { Notifier, User } from '@app/core'
|
||||||
import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators'
|
import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators'
|
||||||
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
||||||
import { Video } from '@app/shared/shared-main'
|
import { Video, Account } from '@app/shared/shared-main'
|
||||||
import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
|
import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { VideoCommentCreate } from '@shared/models'
|
import { VideoCommentCreate } from '@shared/models'
|
||||||
|
@ -145,7 +145,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
|
||||||
|
|
||||||
getAvatarUrl () {
|
getAvatarUrl () {
|
||||||
if (this.user) return this.user.accountAvatarUrl
|
if (this.user) return this.user.accountAvatarUrl
|
||||||
return window.location.origin + '/client/assets/images/default-avatar.png'
|
return Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
gotoLogin () {
|
gotoLogin () {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
|
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
|
||||||
import { MarkdownService, Notifier, UserService } from '@app/core'
|
import { MarkdownService, Notifier, UserService } from '@app/core'
|
||||||
import { AuthService } from '@app/core/auth'
|
import { AuthService } from '@app/core/auth'
|
||||||
import { Account, Actor, DropdownAction, Video } from '@app/shared/shared-main'
|
import { Account, DropdownAction, Video } from '@app/shared/shared-main'
|
||||||
import { CommentReportComponent } from '@app/shared/shared-moderation/report-modals/comment-report.component'
|
import { CommentReportComponent } from '@app/shared/shared-moderation/report-modals/comment-report.component'
|
||||||
import { VideoComment, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
|
import { VideoComment, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
|
||||||
import { User, UserRight } from '@shared/models'
|
import { User, UserRight } from '@shared/models'
|
||||||
|
@ -130,7 +130,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
isNotDeletedOrDeletedWithReplies () {
|
isNotDeletedOrDeletedWithReplies () {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { durationToString } from '@app/helpers'
|
import { durationToString } from '@app/helpers'
|
||||||
import { Actor } from '@app/shared/shared-main'
|
import { Account } from '@app/shared/shared-main'
|
||||||
import { AbusePredefinedReasonsString } from '@shared/models'
|
import { AbusePredefinedReasonsString } from '@shared/models'
|
||||||
import { ProcessedAbuse } from './processed-abuse.model'
|
import { ProcessedAbuse } from './processed-abuse.model'
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ export class AbuseDetailsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeAbuse (abuse: AdminAbuse) {
|
async removeAbuse (abuse: AdminAbuse) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, forwardRef, Input } from '@angular/core'
|
import { Component, forwardRef, Input } from '@angular/core'
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
||||||
import { Actor } from '@app/shared/shared-main/account/actor.model'
|
import { VideoChannel } from '@app/shared/shared-main'
|
||||||
|
|
||||||
export type SelectChannelItem = {
|
export type SelectChannelItem = {
|
||||||
id: number
|
id: number
|
||||||
|
@ -34,7 +34,7 @@ export class SelectChannelComponent implements ControlValueAccessor {
|
||||||
|
|
||||||
get channels () {
|
get channels () {
|
||||||
return this.items.map(c => Object.assign(c, {
|
return this.items.map(c => Object.assign(c, {
|
||||||
avatarPath: c.avatarPath ? c.avatarPath : Actor.GET_DEFAULT_AVATAR_URL()
|
avatarPath: c.avatarPath ? c.avatarPath : VideoChannel.GET_DEFAULT_AVATAR_URL()
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Account as ServerAccount } from '@shared/models/actors/account.model'
|
import { Account as ServerAccount, Avatar } from '@shared/models'
|
||||||
import { Actor } from './actor.model'
|
import { Actor } from './actor.model'
|
||||||
|
|
||||||
export class Account extends Actor implements ServerAccount {
|
export class Account extends Actor implements ServerAccount {
|
||||||
|
@ -13,9 +13,19 @@ export class Account extends Actor implements ServerAccount {
|
||||||
|
|
||||||
userId?: number
|
userId?: number
|
||||||
|
|
||||||
|
static GET_ACTOR_AVATAR_URL (actor: object) {
|
||||||
|
return Actor.GET_ACTOR_AVATAR_URL(actor) || this.GET_DEFAULT_AVATAR_URL()
|
||||||
|
}
|
||||||
|
|
||||||
|
static GET_DEFAULT_AVATAR_URL () {
|
||||||
|
return `${window.location.origin}/client/assets/images/default-avatar-account.png`
|
||||||
|
}
|
||||||
|
|
||||||
constructor (hash: ServerAccount) {
|
constructor (hash: ServerAccount) {
|
||||||
super(hash)
|
super(hash)
|
||||||
|
|
||||||
|
this.updateComputedAttributes()
|
||||||
|
|
||||||
this.displayName = hash.displayName
|
this.displayName = hash.displayName
|
||||||
this.description = hash.description
|
this.description = hash.description
|
||||||
this.userId = hash.userId
|
this.userId = hash.userId
|
||||||
|
@ -27,4 +37,14 @@ export class Account extends Actor implements ServerAccount {
|
||||||
this.mutedServerByUser = false
|
this.mutedServerByUser = false
|
||||||
this.mutedServerByInstance = false
|
this.mutedServerByInstance = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateAvatar (newAvatar: Avatar) {
|
||||||
|
this.avatar = newAvatar
|
||||||
|
|
||||||
|
this.updateComputedAttributes()
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateComputedAttributes () {
|
||||||
|
this.avatarUrl = Account.GET_ACTOR_AVATAR_URL(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,6 @@ export abstract class Actor implements ActorServer {
|
||||||
|
|
||||||
return absoluteAPIUrl + actor.avatar.path
|
return absoluteAPIUrl + actor.avatar.path
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.GET_DEFAULT_AVATAR_URL()
|
|
||||||
}
|
|
||||||
|
|
||||||
static GET_DEFAULT_AVATAR_URL () {
|
|
||||||
return window.location.origin + '/client/assets/images/default-avatar.png'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) {
|
static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) {
|
||||||
|
@ -61,17 +55,5 @@ export abstract class Actor implements ActorServer {
|
||||||
|
|
||||||
this.avatar = hash.avatar
|
this.avatar = hash.avatar
|
||||||
this.isLocal = Actor.IS_LOCAL(this.host)
|
this.isLocal = Actor.IS_LOCAL(this.host)
|
||||||
|
|
||||||
this.updateComputedAttributes()
|
|
||||||
}
|
|
||||||
|
|
||||||
updateAvatar (newAvatar: Avatar) {
|
|
||||||
this.avatar = newAvatar
|
|
||||||
|
|
||||||
this.updateComputedAttributes()
|
|
||||||
}
|
|
||||||
|
|
||||||
private updateComputedAttributes () {
|
|
||||||
this.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(this)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
VideoInfo,
|
VideoInfo,
|
||||||
UserRight
|
UserRight
|
||||||
} from '@shared/models'
|
} from '@shared/models'
|
||||||
import { Actor } from '../account/actor.model'
|
import { Account, Actor, VideoChannel } from '@app/shared/shared-main'
|
||||||
import { AuthUser } from '@app/core'
|
import { AuthUser } from '@app/core'
|
||||||
|
|
||||||
export class UserNotification implements UserNotificationServer {
|
export class UserNotification implements UserNotificationServer {
|
||||||
|
@ -95,22 +95,22 @@ export class UserNotification implements UserNotificationServer {
|
||||||
// To prevent a notification popup crash in case of bug, wrap it inside a try/catch
|
// To prevent a notification popup crash in case of bug, wrap it inside a try/catch
|
||||||
try {
|
try {
|
||||||
this.video = hash.video
|
this.video = hash.video
|
||||||
if (this.video) this.setAvatarUrl(this.video.channel)
|
if (this.video) this.setVideoChannelAvatarUrl(this.video.channel)
|
||||||
|
|
||||||
this.videoImport = hash.videoImport
|
this.videoImport = hash.videoImport
|
||||||
|
|
||||||
this.comment = hash.comment
|
this.comment = hash.comment
|
||||||
if (this.comment) this.setAvatarUrl(this.comment.account)
|
if (this.comment) this.setAccountAvatarUrl(this.comment.account)
|
||||||
|
|
||||||
this.abuse = hash.abuse
|
this.abuse = hash.abuse
|
||||||
|
|
||||||
this.videoBlacklist = hash.videoBlacklist
|
this.videoBlacklist = hash.videoBlacklist
|
||||||
|
|
||||||
this.account = hash.account
|
this.account = hash.account
|
||||||
if (this.account) this.setAvatarUrl(this.account)
|
if (this.account) this.setAccountAvatarUrl(this.account)
|
||||||
|
|
||||||
this.actorFollow = hash.actorFollow
|
this.actorFollow = hash.actorFollow
|
||||||
if (this.actorFollow) this.setAvatarUrl(this.actorFollow.follower)
|
if (this.actorFollow) this.setAccountAvatarUrl(this.actorFollow.follower)
|
||||||
|
|
||||||
this.createdAt = hash.createdAt
|
this.createdAt = hash.createdAt
|
||||||
this.updatedAt = hash.updatedAt
|
this.updatedAt = hash.updatedAt
|
||||||
|
@ -222,7 +222,11 @@ export class UserNotification implements UserNotificationServer {
|
||||||
return [ this.buildVideoUrl(comment.video), { threadId: comment.threadId } ]
|
return [ this.buildVideoUrl(comment.video), { threadId: comment.threadId } ]
|
||||||
}
|
}
|
||||||
|
|
||||||
private setAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
|
private setAccountAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
|
||||||
actor.avatarUrl = Actor.GET_ACTOR_AVATAR_URL(actor)
|
actor.avatarUrl = Account.GET_ACTOR_AVATAR_URL(actor)
|
||||||
|
}
|
||||||
|
|
||||||
|
private setVideoChannelAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
|
||||||
|
actor.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { VideoChannel as ServerVideoChannel, ViewsPerDate, Account } from '@shared/models'
|
import { VideoChannel as ServerVideoChannel, ViewsPerDate, Account, Avatar } from '@shared/models'
|
||||||
import { Actor } from '../account/actor.model'
|
import { Actor } from '../account/actor.model'
|
||||||
|
|
||||||
export class VideoChannel extends Actor implements ServerVideoChannel {
|
export class VideoChannel extends Actor implements ServerVideoChannel {
|
||||||
|
@ -17,9 +17,19 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
|
||||||
|
|
||||||
viewsPerDay?: ViewsPerDate[]
|
viewsPerDay?: ViewsPerDate[]
|
||||||
|
|
||||||
|
static GET_ACTOR_AVATAR_URL (actor: object) {
|
||||||
|
return Actor.GET_ACTOR_AVATAR_URL(actor) || this.GET_DEFAULT_AVATAR_URL()
|
||||||
|
}
|
||||||
|
|
||||||
|
static GET_DEFAULT_AVATAR_URL () {
|
||||||
|
return `${window.location.origin}/client/assets/images/default-avatar-videochannel.png`
|
||||||
|
}
|
||||||
|
|
||||||
constructor (hash: ServerVideoChannel) {
|
constructor (hash: ServerVideoChannel) {
|
||||||
super(hash)
|
super(hash)
|
||||||
|
|
||||||
|
this.updateComputedAttributes()
|
||||||
|
|
||||||
this.displayName = hash.displayName
|
this.displayName = hash.displayName
|
||||||
this.description = hash.description
|
this.description = hash.description
|
||||||
this.support = hash.support
|
this.support = hash.support
|
||||||
|
@ -39,4 +49,14 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
|
||||||
this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
|
this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateAvatar (newAvatar: Avatar) {
|
||||||
|
this.avatar = newAvatar
|
||||||
|
|
||||||
|
this.updateComputedAttributes()
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateComputedAttributes () {
|
||||||
|
this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
VideoScheduleUpdate,
|
VideoScheduleUpdate,
|
||||||
VideoState
|
VideoState
|
||||||
} from '@shared/models'
|
} from '@shared/models'
|
||||||
import { Actor } from '../account/actor.model'
|
import { Account, Actor, VideoChannel } from '@app/shared/shared-main'
|
||||||
|
|
||||||
export class Video implements VideoServerModel {
|
export class Video implements VideoServerModel {
|
||||||
byVideoChannel: string
|
byVideoChannel: string
|
||||||
|
@ -142,8 +142,8 @@ export class Video implements VideoServerModel {
|
||||||
|
|
||||||
this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host)
|
this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host)
|
||||||
this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host)
|
this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host)
|
||||||
this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
|
this.accountAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.account)
|
||||||
this.videoChannelAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.channel)
|
this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.channel)
|
||||||
|
|
||||||
this.category.label = peertubeTranslate(this.category.label, translations)
|
this.category.label = peertubeTranslate(this.category.label, translations)
|
||||||
this.licence.label = peertubeTranslate(this.licence.label, translations)
|
this.licence.label = peertubeTranslate(this.licence.label, translations)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SortMeta } from 'primeng/api'
|
import { SortMeta } from 'primeng/api'
|
||||||
import { Directive, OnInit } from '@angular/core'
|
import { Directive, OnInit } from '@angular/core'
|
||||||
import { Notifier, RestPagination, RestTable } from '@app/core'
|
import { Notifier, RestPagination, RestTable } from '@app/core'
|
||||||
import { Actor } from '@app/shared/shared-main'
|
import { Account } from '@app/shared/shared-main'
|
||||||
import { AccountBlock } from './account-block.model'
|
import { AccountBlock } from './account-block.model'
|
||||||
import { BlocklistComponentType, BlocklistService } from './blocklist.service'
|
import { BlocklistComponentType, BlocklistService } from './blocklist.service'
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export class GenericAccountBlocklistComponent extends RestTable implements OnIni
|
||||||
}
|
}
|
||||||
|
|
||||||
switchToDefaultAvatar ($event: Event) {
|
switchToDefaultAvatar ($event: Event) {
|
||||||
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
|
||||||
}
|
}
|
||||||
|
|
||||||
unblockAccount (accountBlock: AccountBlock) {
|
unblockAccount (accountBlock: AccountBlock) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAbsoluteAPIUrl } from '@app/helpers'
|
import { getAbsoluteAPIUrl } from '@app/helpers'
|
||||||
import { Actor } from '@app/shared/shared-main'
|
import { Account, Actor } from '@app/shared/shared-main'
|
||||||
import { Account as AccountInterface, VideoComment as VideoCommentServerModel, VideoCommentAdmin as VideoCommentAdminServerModel } from '@shared/models'
|
import { Account as AccountInterface, VideoComment as VideoCommentServerModel, VideoCommentAdmin as VideoCommentAdminServerModel } from '@shared/models'
|
||||||
|
|
||||||
export class VideoComment implements VideoCommentServerModel {
|
export class VideoComment implements VideoCommentServerModel {
|
||||||
|
@ -38,7 +38,7 @@ export class VideoComment implements VideoCommentServerModel {
|
||||||
|
|
||||||
if (this.account) {
|
if (this.account) {
|
||||||
this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
|
this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
|
||||||
this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
|
this.accountAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.account)
|
||||||
|
|
||||||
const absoluteAPIUrl = getAbsoluteAPIUrl()
|
const absoluteAPIUrl = getAbsoluteAPIUrl()
|
||||||
const thisHost = new URL(absoluteAPIUrl).host
|
const thisHost = new URL(absoluteAPIUrl).host
|
||||||
|
@ -97,7 +97,7 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel {
|
||||||
|
|
||||||
if (this.account) {
|
if (this.account) {
|
||||||
this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
|
this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
|
||||||
this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
|
this.accountAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.account)
|
||||||
|
|
||||||
this.account.localUrl = '/accounts/' + this.by
|
this.account.localUrl = '/accounts/' + this.by
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
|
import { getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
|
||||||
import { Actor } from '@app/shared/shared-main'
|
import { Account, Actor, VideoChannel } from '@app/shared/shared-main'
|
||||||
import { peertubeTranslate } from '@shared/core-utils/i18n'
|
import { peertubeTranslate } from '@shared/core-utils/i18n'
|
||||||
import {
|
import {
|
||||||
AccountSummary,
|
AccountSummary,
|
||||||
|
@ -78,12 +78,12 @@ export class VideoPlaylist implements ServerVideoPlaylist {
|
||||||
|
|
||||||
this.ownerAccount = hash.ownerAccount
|
this.ownerAccount = hash.ownerAccount
|
||||||
this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
|
this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
|
||||||
this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
|
this.ownerAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.ownerAccount)
|
||||||
|
|
||||||
if (hash.videoChannel) {
|
if (hash.videoChannel) {
|
||||||
this.videoChannel = hash.videoChannel
|
this.videoChannel = hash.videoChannel
|
||||||
this.videoChannelBy = Actor.CREATE_BY_STRING(hash.videoChannel.name, hash.videoChannel.host)
|
this.videoChannelBy = Actor.CREATE_BY_STRING(hash.videoChannel.name, hash.videoChannel.host)
|
||||||
this.videoChannelAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.videoChannel)
|
this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.videoChannel)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.privacy.label = peertubeTranslate(this.privacy.label, translations)
|
this.privacy.label = peertubeTranslate(this.privacy.label, translations)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue