From 60650c77c8a2a98e92d869b237ae4900f369a8fc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 11 Jan 2018 09:35:50 +0100 Subject: Add scores to follows and remove bad ones --- shared/models/actors/account.model.ts | 14 ++------------ shared/models/actors/actor.model.ts | 14 ++++++++++++++ shared/models/actors/follow.model.ts | 7 ++++--- shared/models/videos/video-channel.model.ts | 9 +++------ 4 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 shared/models/actors/actor.model.ts (limited to 'shared') diff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.ts index e4dbc81e5..5cc12c18f 100644 --- a/shared/models/actors/account.model.ts +++ b/shared/models/actors/account.model.ts @@ -1,15 +1,5 @@ -import { Avatar } from '../avatars/avatar.model' +import { Actor } from './actor.model' -export interface Account { - id: number - uuid: string - url: string - name: string +export interface Account extends Actor { displayName: string - host: string - followingCount: number - followersCount: number - createdAt: Date - updatedAt: Date - avatar: Avatar } diff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.ts new file mode 100644 index 000000000..f91616519 --- /dev/null +++ b/shared/models/actors/actor.model.ts @@ -0,0 +1,14 @@ +import { Avatar } from '../avatars/avatar.model' + +export interface Actor { + id: number + uuid: string + url: string + name: string + host: string + followingCount: number + followersCount: number + createdAt: Date + updatedAt: Date + avatar: Avatar +} diff --git a/shared/models/actors/follow.model.ts b/shared/models/actors/follow.model.ts index cdc3da560..70562bfc7 100644 --- a/shared/models/actors/follow.model.ts +++ b/shared/models/actors/follow.model.ts @@ -1,11 +1,12 @@ -import { Account } from './account.model' +import { Actor } from './actor.model' export type FollowState = 'pending' | 'accepted' export interface AccountFollow { id: number - follower: Account - following: Account + follower: Actor + following: Actor + score: number state: FollowState createdAt: Date updatedAt: Date diff --git a/shared/models/videos/video-channel.model.ts b/shared/models/videos/video-channel.model.ts index d1a952826..b164fb555 100644 --- a/shared/models/videos/video-channel.model.ts +++ b/shared/models/videos/video-channel.model.ts @@ -1,13 +1,10 @@ +import { Actor } from '../actors/actor.model' import { Video } from './video.model' -export interface VideoChannel { - id: number - name: string - url: string +export interface VideoChannel extends Actor { + displayName: string description: string isLocal: boolean - createdAt: Date | string - updatedAt: Date | string owner?: { name: string uuid: string -- cgit v1.2.3