ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove banner/avatar fields from channel/account
Chocobozzzf932957b2e33
diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.tsindex 77bf9171bd..bce0409709 100644--- a/client/src/app/shared/shared-main/account/actor.model.ts+++ b/client/src/app/shared/shared-main/account/actor.model.ts@@ -13,9 +13,6 @@ export abstract class Actor implements ServerActor {createdAt: Date | string- // TODO: remove, deprecated in 4.2- avatar: never-avatars: ActorImage[]isLocal: booleandiff --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.tsindex 62bd943490..db3e4b43fd 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@@ -12,9 +12,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel {nameWithHost: stringnameWithHostForced: string- // TODO: remove, deprecated in 4.2- banner: never-banners: ActorImage[]bannerUrl: stringdiff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.tsindex 392dcadd06..1d077a6130 100644--- a/client/src/app/shared/shared-main/video/video.model.ts+++ b/client/src/app/shared/shared-main/video/video.model.ts@@ -86,9 +86,6 @@ export class Video implements VideoServerModel {url: stringhost: string- // TODO: remove, deprecated in 4.2- avatar: ActorImage-avatars: ActorImage[]}@@ -99,9 +96,6 @@ export class Video implements VideoServerModel {url: stringhost: string- // TODO: remove, deprecated in 4.2- avatar: ActorImage-avatars: ActorImage[]}diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.tsindex 4753308e8b..26811136ed 100644--- a/server/controllers/api/users/me.ts+++ b/server/controllers/api/users/me.ts@@ -1,7 +1,6 @@import 'multer'import express from 'express'import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'-import { getBiggestActorImage } from '@server/lib/actor-image'import { Hooks } from '@server/lib/plugins/hooks'import { pick } from '@shared/core-utils'import { ActorImageType, HttpStatusCode, UserUpdateMe, UserVideoQuota, UserVideoRate as FormattedUserVideoRate } from '@shared/models'@@ -264,8 +263,6 @@ async function updateMyAvatar (req: express.Request, res: express.Response) {)return res.json({- // TODO: remove, deprecated in 4.2- avatar: getBiggestActorImage(avatars).toFormattedJSON(),avatars: avatars.map(avatar => avatar.toFormattedJSON())})}diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.tsindex 3d7ef31ee2..18de5bf6a2 100644--- a/server/controllers/api/video-channel.ts+++ b/server/controllers/api/video-channel.ts@@ -1,6 +1,5 @@import express from 'express'import { pickCommonVideoQuery } from '@server/helpers/query'-import { getBiggestActorImage } from '@server/lib/actor-image'import { Hooks } from '@server/lib/plugins/hooks'import { ActorFollowModel } from '@server/models/actor/actor-follow'import { getServerActor } from '@server/models/application/application'@@ -213,8 +212,6 @@ async function updateVideoChannelBanner (req: express.Request, res: express.RespauditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys)return res.json({- // TODO: remove, deprecated in 4.2- banner: getBiggestActorImage(banners).toFormattedJSON(),banners: banners.map(b => b.toFormattedJSON())})}@@ -228,8 +225,6 @@ async function updateVideoChannelAvatar (req: express.Request, res: express.RespauditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys)return res.json({- // TODO: remove, deprecated in 4.2- avatar: getBiggestActorImage(avatars).toFormattedJSON(),avatars: avatars.map(a => a.toFormattedJSON())})}diff --git a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts b/server/lib/activitypub/actors/shared/object-to-model-attributes.tsindex d854bf2b53..3ce332681e 100644--- a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts+++ b/server/lib/activitypub/actors/shared/object-to-model-attributes.ts@@ -32,7 +32,7 @@ function getActorAttributesFromObject (function getImagesInfoFromObject (actorObject: ActivityPubActor, type: ActorImageType) {const iconsOrImages = type === ActorImageType.AVATAR- ? actorObject.icons || actorObject.icon+ ? actorObject.icon: actorObject.imagereturn normalizeIconOrImage(iconsOrImages)diff --git a/server/lib/activitypub/context.ts b/server/lib/activitypub/context.tsindex eba6d636d3..87eb498a35 100644--- a/server/lib/activitypub/context.ts+++ b/server/lib/activitypub/context.ts@@ -27,9 +27,6 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: stringlanguage: 'sc:inLanguage',identifier: 'sc:identifier',- // TODO: remove in a few versions, introduced in 4.2- icons: 'as:icon',-isLiveBroadcast: 'sc:isLiveBroadcast',liveSaveReplay: {'@type': 'sc:Boolean',diff --git a/server/models/account/account.ts b/server/models/account/account.tsindex 396959352c..8593f2f28f 100644--- a/server/models/account/account.ts+++ b/server/models/account/account.ts@@ -433,10 +433,7 @@ export class AccountModel extends Model<Partial<AttributesOnly<AccountModel>>> {name: actor.name,url: actor.url,host: actor.host,- avatars: actor.avatars,-- // TODO: remove, deprecated in 4.2- avatar: actor.avatar+ avatars: actor.avatars}}diff --git a/server/models/actor/actor.ts b/server/models/actor/actor.tsindex dccb47a10a..e2e85f3d6f 100644--- a/server/models/actor/actor.ts+++ b/server/models/actor/actor.ts@@ -540,12 +540,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {url: this.url,name: this.preferredUsername,host: this.getHost(),- avatars: (this.Avatars || []).map(a => a.toFormattedJSON()),-- // TODO: remove, deprecated in 4.2- avatar: this.hasImage(ActorImageType.AVATAR)- ? this.Avatars[0].toFormattedJSON()- : undefined+ avatars: (this.Avatars || []).map(a => a.toFormattedJSON())}}@@ -559,23 +554,16 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {followersCount: this.followersCount,createdAt: this.getCreatedAt(),- banners: (this.Banners || []).map(b => b.toFormattedJSON()),-- // TODO: remove, deprecated in 4.2- banner: this.hasImage(ActorImageType.BANNER)- ? this.Banners[0].toFormattedJSON()- : undefined+ banners: (this.Banners || []).map(b => b.toFormattedJSON())}}toActivityPubObject (this: MActorAPChannel | MActorAPAccount, name: string) {- let icon: ActivityIconObject- let icons: ActivityIconObject[]+ let icon: ActivityIconObject[]let image: ActivityIconObjectif (this.hasImage(ActorImageType.AVATAR)) {- icon = getBiggestActorImage(this.Avatars).toActivityPubObject()- icons = this.Avatars.map(a => a.toActivityPubObject())+ icon = this.Avatars.map(a => a.toActivityPubObject())}if (this.hasImage(ActorImageType.BANNER)) {@@ -613,7 +601,6 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {published: this.getCreatedAt().toISOString(),icon,- icons,image}diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.tsindex 19dd681a70..2c38850d70 100644--- a/server/models/video/video-channel.ts+++ b/server/models/video/video-channel.ts@@ -779,10 +779,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChanneldisplayName: this.getDisplayName(),url: actor.url,host: actor.host,- avatars: actor.avatars,-- // TODO: remove, deprecated in 4.2- avatar: actor.avatar+ avatars: actor.avatars}}@@ -821,10 +818,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannelviewsPerDay,totalViews,- avatars: actor.avatars,-- // TODO: remove, deprecated in 4.2- avatar: actor.avatar+ avatars: actor.avatars}if (this.Account) videoChannel.ownerAccount = this.Account.toFormattedJSON()diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.tsindex 21473b6bf0..cbe628cccc 100644--- a/server/tests/api/search/search-index.ts+++ b/server/tests/api/search/search-index.ts@@ -107,15 +107,11 @@ describe('Test index search', function () {expect(video.account.host).to.equal('framatube.org')expect(video.account.name).to.equal('framasoft')expect(video.account.url).to.equal('https://framatube.org/accounts/framasoft')- // TODO: remove, deprecated in 4.2- expect(video.account.avatar).to.existexpect(video.account.avatars.length).to.equal(2, 'Account should have one avatar image')expect(video.channel.host).to.equal('framatube.org')expect(video.channel.name).to.equal('joinpeertube')expect(video.channel.url).to.equal('https://framatube.org/video-channels/joinpeertube')- // TODO: remove, deprecated in 4.2- expect(video.channel.avatar).to.existexpect(video.channel.avatars.length).to.equal(2, 'Channel should have one avatar image')}@@ -293,16 +289,12 @@ describe('Test index search', function () {const videoChannel = body.data[0]expect(videoChannel.url).to.equal('https://framatube.org/video-channels/bf54d359-cfad-4935-9d45-9d6be93f63e8')expect(videoChannel.host).to.equal('framatube.org')- // TODO: remove, deprecated in 4.2- expect(videoChannel.avatar).to.existexpect(videoChannel.avatars.length).to.equal(2, 'Channel should have two avatar images')expect(videoChannel.displayName).to.existexpect(videoChannel.ownerAccount.url).to.equal('https://framatube.org/accounts/framasoft')expect(videoChannel.ownerAccount.name).to.equal('framasoft')expect(videoChannel.ownerAccount.host).to.equal('framatube.org')- // TODO: remove, deprecated in 4.2- expect(videoChannel.ownerAccount.avatar).to.existexpect(videoChannel.ownerAccount.avatars.length).to.equal(2, 'Account should have two avatar images')}@@ -369,15 +361,11 @@ describe('Test index search', function () {expect(videoPlaylist.ownerAccount.url).to.equal('https://peertube2.cpy.re/accounts/chocobozzz')expect(videoPlaylist.ownerAccount.name).to.equal('chocobozzz')expect(videoPlaylist.ownerAccount.host).to.equal('peertube2.cpy.re')- // TODO: remove, deprecated in 4.2- expect(videoPlaylist.ownerAccount.avatar).to.existexpect(videoPlaylist.ownerAccount.avatars.length).to.equal(2, 'Account should have two avatar images')expect(videoPlaylist.videoChannel.url).to.equal('https://peertube2.cpy.re/video-channels/chocobozzz_channel')expect(videoPlaylist.videoChannel.name).to.equal('chocobozzz_channel')expect(videoPlaylist.videoChannel.host).to.equal('peertube2.cpy.re')- // TODO: remove, deprecated in 4.2- expect(videoPlaylist.videoChannel.avatar).to.existexpect(videoPlaylist.videoChannel.avatars.length).to.equal(2, 'Channel should have two avatar images')}diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.tsindex efb6edec48..b86bcb7647 100644--- a/shared/models/activitypub/activitypub-actor.ts+++ b/shared/models/activitypub/activitypub-actor.ts@@ -28,10 +28,7 @@ export interface ActivityPubActor {}image?: ActivityIconObject | ActivityIconObject[]-icon?: ActivityIconObject | ActivityIconObject[]- // TODO: migrate to `icon`, introduced in 4.2- icons?: ActivityIconObject[]published?: string}diff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.tsindex 60f4236d5e..9fbec60ba0 100644--- a/shared/models/actors/account.model.ts+++ b/shared/models/actors/account.model.ts@@ -19,7 +19,4 @@ export interface AccountSummary {host: stringavatars: ActorImage[]-- // TODO: remove, deprecated in 4.2- avatar: ActorImage}diff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.tsindex bf86a917f5..ab07602632 100644--- a/shared/models/actors/actor.model.ts+++ b/shared/models/actors/actor.model.ts@@ -10,7 +10,4 @@ export interface Actor {createdAt: Date | stringavatars: ActorImage[]-- // TODO: remove, deprecated in 4.2- avatar: ActorImage}diff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.tsindex 68e2f9c4c8..ce5fc0e8d0 100644--- a/shared/models/videos/channel/video-channel.model.ts+++ b/shared/models/videos/channel/video-channel.model.ts@@ -21,9 +21,6 @@ export interface VideoChannel extends Actor {totalViews?: numberbanners: ActorImage[]-- // TODO: remove, deprecated in 4.2- banner: ActorImage}export interface VideoChannelSummary {@@ -34,7 +31,4 @@ export interface VideoChannelSummary {host: stringavatars: ActorImage[]-- // TODO: remove, deprecated in 4.2- avatar: ActorImage}