diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-06 11:35:56 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-04-08 10:07:53 +0200 |
commit | f479685678406a5df864d89615b33d29085ebfc6 (patch) | |
tree | 8de15e90cd8d97d8810715df8585c61f48d5282a /shared/models | |
parent | 968aaed2066873fc1c39f95168284122d9d15e21 (diff) | |
download | PeerTube-f479685678406a5df864d89615b33d29085ebfc6.tar.gz PeerTube-f479685678406a5df864d89615b33d29085ebfc6.tar.zst PeerTube-f479685678406a5df864d89615b33d29085ebfc6.zip |
Agnostic actor image storage
Diffstat (limited to 'shared/models')
-rw-r--r-- | shared/models/actors/account.model.ts | 4 | ||||
-rw-r--r-- | shared/models/actors/actor-image.model.ts (renamed from shared/models/avatars/avatar.model.ts) | 2 | ||||
-rw-r--r-- | shared/models/actors/actor-image.type.ts | 4 | ||||
-rw-r--r-- | shared/models/actors/actor.model.ts | 4 | ||||
-rw-r--r-- | shared/models/actors/index.ts | 2 | ||||
-rw-r--r-- | shared/models/avatars/index.ts | 1 | ||||
-rw-r--r-- | shared/models/index.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/channel/video-channel.model.ts | 5 |
8 files changed, 13 insertions, 10 deletions
diff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.ts index 2ff4b9f5e..120dec271 100644 --- a/shared/models/actors/account.model.ts +++ b/shared/models/actors/account.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ActorImage } from './actor-image.model' | ||
1 | import { Actor } from './actor.model' | 2 | import { Actor } from './actor.model' |
2 | import { Avatar } from '../avatars' | ||
3 | 3 | ||
4 | export interface Account extends Actor { | 4 | export interface Account extends Actor { |
5 | displayName: string | 5 | displayName: string |
@@ -14,5 +14,5 @@ export interface AccountSummary { | |||
14 | displayName: string | 14 | displayName: string |
15 | url: string | 15 | url: string |
16 | host: string | 16 | host: string |
17 | avatar?: Avatar | 17 | avatar?: ActorImage |
18 | } | 18 | } |
diff --git a/shared/models/avatars/avatar.model.ts b/shared/models/actors/actor-image.model.ts index f7fa16f49..ad5eab627 100644 --- a/shared/models/avatars/avatar.model.ts +++ b/shared/models/actors/actor-image.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | export interface Avatar { | 1 | export interface ActorImage { |
2 | path: string | 2 | path: string |
3 | 3 | ||
4 | url?: string | 4 | url?: string |
diff --git a/shared/models/actors/actor-image.type.ts b/shared/models/actors/actor-image.type.ts new file mode 100644 index 000000000..ac8eb6bf2 --- /dev/null +++ b/shared/models/actors/actor-image.type.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export const enum ActorImageType { | ||
2 | AVATAR = 1, | ||
3 | BANNER = 2 | ||
4 | } | ||
diff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.ts index 1dbf5f638..7d9f35b10 100644 --- a/shared/models/actors/actor.model.ts +++ b/shared/models/actors/actor.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Avatar } from '../avatars/avatar.model' | 1 | import { ActorImage } from './actor-image.model' |
2 | 2 | ||
3 | export interface Actor { | 3 | export interface Actor { |
4 | id: number | 4 | id: number |
@@ -9,5 +9,5 @@ export interface Actor { | |||
9 | followersCount: number | 9 | followersCount: number |
10 | createdAt: Date | string | 10 | createdAt: Date | string |
11 | updatedAt: Date | string | 11 | updatedAt: Date | string |
12 | avatar?: Avatar | 12 | avatar?: ActorImage |
13 | } | 13 | } |
diff --git a/shared/models/actors/index.ts b/shared/models/actors/index.ts index c7a92399d..156f83248 100644 --- a/shared/models/actors/index.ts +++ b/shared/models/actors/index.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | export * from './account.model' | 1 | export * from './account.model' |
2 | export * from './actor-image.model' | ||
3 | export * from './actor-image.type' | ||
2 | export * from './actor.model' | 4 | export * from './actor.model' |
3 | export * from './follow.model' | 5 | export * from './follow.model' |
diff --git a/shared/models/avatars/index.ts b/shared/models/avatars/index.ts deleted file mode 100644 index 65e8e0882..000000000 --- a/shared/models/avatars/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './avatar.model' | ||
diff --git a/shared/models/index.ts b/shared/models/index.ts index f105303f4..dff5fdf0e 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | export * from './activitypub' | 1 | export * from './activitypub' |
2 | export * from './actors' | 2 | export * from './actors' |
3 | export * from './avatars' | ||
4 | export * from './moderation' | 3 | export * from './moderation' |
5 | export * from './bulk' | 4 | export * from './bulk' |
6 | export * from './redundancy' | 5 | export * from './redundancy' |
diff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.ts index 32829e92a..ae6dea42d 100644 --- a/shared/models/videos/channel/video-channel.model.ts +++ b/shared/models/videos/channel/video-channel.model.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Actor } from '../../actors/actor.model' | 1 | import { Actor } from '../../actors/actor.model' |
2 | import { Account } from '../../actors/index' | 2 | import { Account, ActorImage } from '../../actors' |
3 | import { Avatar } from '../../avatars' | ||
4 | 3 | ||
5 | export type ViewsPerDate = { | 4 | export type ViewsPerDate = { |
6 | date: Date | 5 | date: Date |
@@ -24,5 +23,5 @@ export interface VideoChannelSummary { | |||
24 | displayName: string | 23 | displayName: string |
25 | url: string | 24 | url: string |
26 | host: string | 25 | host: string |
27 | avatar?: Avatar | 26 | avatar?: ActorImage |
28 | } | 27 | } |