mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Basic video redundancy implementation
This commit is contained in:
parent
a651038487
commit
c48e82b5e0
77 changed files with 1667 additions and 287 deletions
|
@ -1,6 +1,6 @@
|
|||
import { ActivityPubActor } from './activitypub-actor'
|
||||
import { ActivityPubSignature } from './activitypub-signature'
|
||||
import { VideoTorrentObject } from './objects'
|
||||
import { CacheFileObject, VideoTorrentObject } from './objects'
|
||||
import { DislikeObject } from './objects/dislike-object'
|
||||
import { VideoAbuseObject } from './objects/video-abuse-object'
|
||||
import { VideoCommentObject } from './objects/video-comment-object'
|
||||
|
@ -29,12 +29,12 @@ export interface BaseActivity {
|
|||
|
||||
export interface ActivityCreate extends BaseActivity {
|
||||
type: 'Create'
|
||||
object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject
|
||||
object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject
|
||||
}
|
||||
|
||||
export interface ActivityUpdate extends BaseActivity {
|
||||
type: 'Update'
|
||||
object: VideoTorrentObject | ActivityPubActor
|
||||
object: VideoTorrentObject | ActivityPubActor | CacheFileObject
|
||||
}
|
||||
|
||||
export interface ActivityDelete extends BaseActivity {
|
||||
|
|
9
shared/models/activitypub/objects/cache-file-object.ts
Normal file
9
shared/models/activitypub/objects/cache-file-object.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { ActivityVideoUrlObject } from './common-objects'
|
||||
|
||||
export interface CacheFileObject {
|
||||
id: string
|
||||
type: 'CacheFile',
|
||||
object: string
|
||||
expires: string
|
||||
url: ActivityVideoUrlObject
|
||||
}
|
|
@ -17,16 +17,31 @@ export interface ActivityIconObject {
|
|||
height: number
|
||||
}
|
||||
|
||||
export interface ActivityUrlObject {
|
||||
export type ActivityVideoUrlObject = {
|
||||
type: 'Link'
|
||||
mimeType: 'video/mp4' | 'video/webm' | 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
|
||||
mimeType: 'video/mp4' | 'video/webm' | 'video/ogg'
|
||||
href: string
|
||||
height: number
|
||||
|
||||
size?: number
|
||||
fps?: number
|
||||
size: number
|
||||
fps: number
|
||||
}
|
||||
|
||||
export type ActivityUrlObject =
|
||||
ActivityVideoUrlObject
|
||||
|
|
||||
{
|
||||
type: 'Link'
|
||||
mimeType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
|
||||
href: string
|
||||
height: number
|
||||
}
|
||||
|
|
||||
{
|
||||
type: 'Link'
|
||||
mimeType: 'text/html'
|
||||
href: string
|
||||
}
|
||||
|
||||
export interface ActivityPubAttributedTo {
|
||||
type: 'Group' | 'Person'
|
||||
id: string
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export * from './cache-file-object'
|
||||
export * from './common-objects'
|
||||
export * from './video-abuse-object'
|
||||
export * from './video-torrent-object'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
ActivityIconObject,
|
||||
ActivityIdentifierObject, ActivityPubAttributedTo,
|
||||
ActivityIdentifierObject,
|
||||
ActivityPubAttributedTo,
|
||||
ActivityTagObject,
|
||||
ActivityUrlObject
|
||||
} from './common-objects'
|
||||
import { ActivityPubOrderedCollection } from '../activitypub-ordered-collection'
|
||||
import { VideoState } from '../../videos'
|
||||
|
||||
export interface VideoTorrentObject {
|
||||
|
|
|
@ -2,10 +2,10 @@ import { Actor } from './actor.model'
|
|||
|
||||
export type FollowState = 'pending' | 'accepted'
|
||||
|
||||
export interface AccountFollow {
|
||||
export interface ActorFollow {
|
||||
id: number
|
||||
follower: Actor
|
||||
following: Actor
|
||||
follower: Actor & { hostRedundancyAllowed: boolean }
|
||||
following: Actor & { hostRedundancyAllowed: boolean }
|
||||
score: number
|
||||
state: FollowState
|
||||
createdAt: Date
|
||||
|
|
1
shared/models/avatars/index.ts
Normal file
1
shared/models/avatars/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './avatar.model'
|
|
@ -1,5 +1,7 @@
|
|||
export * from './actors'
|
||||
export * from './activitypub'
|
||||
export * from './actors'
|
||||
export * from './avatars'
|
||||
export * from './redundancy'
|
||||
export * from './users'
|
||||
export * from './videos'
|
||||
export * from './feeds'
|
||||
|
|
1
shared/models/redundancy/index.ts
Normal file
1
shared/models/redundancy/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './videos-redundancy.model'
|
6
shared/models/redundancy/videos-redundancy.model.ts
Normal file
6
shared/models/redundancy/videos-redundancy.model.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
export type VideoRedundancyStrategy = 'most-views'
|
||||
|
||||
export interface VideosRedundancy {
|
||||
strategy: VideoRedundancyStrategy
|
||||
size: number
|
||||
}
|
|
@ -3,6 +3,7 @@ export enum UserRight {
|
|||
|
||||
MANAGE_USERS,
|
||||
MANAGE_SERVER_FOLLOW,
|
||||
MANAGE_SERVER_REDUNDANCY,
|
||||
MANAGE_VIDEO_ABUSES,
|
||||
MANAGE_JOBS,
|
||||
MANAGE_CONFIGURATION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue