diff options
author | Chocobozzz <me@florianbigard.com> | 2023-08-28 10:55:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-08-28 16:17:31 +0200 |
commit | 77b70702d2193d78bf6fbd07f0fc7335e34957f8 (patch) | |
tree | 1a0aed540054286c9a8b10c4890cc0f718e00458 /packages/models | |
parent | 7113f32a87bd6b2868154fed20bde1a1633c190e (diff) | |
download | PeerTube-77b70702d2193d78bf6fbd07f0fc7335e34957f8.tar.gz PeerTube-77b70702d2193d78bf6fbd07f0fc7335e34957f8.tar.zst PeerTube-77b70702d2193d78bf6fbd07f0fc7335e34957f8.zip |
Add video chapters support
Diffstat (limited to 'packages/models')
8 files changed, 28 insertions, 1 deletions
diff --git a/packages/models/src/activitypub/context.ts b/packages/models/src/activitypub/context.ts index e9df38207..e52463c6c 100644 --- a/packages/models/src/activitypub/context.ts +++ b/packages/models/src/activitypub/context.ts | |||
@@ -13,4 +13,5 @@ export type ContextType = | |||
13 | 'Flag' | | 13 | 'Flag' | |
14 | 'Actor' | | 14 | 'Actor' | |
15 | 'Collection' | | 15 | 'Collection' | |
16 | 'WatchAction' | 16 | 'WatchAction' | |
17 | 'Chapters' | ||
diff --git a/packages/models/src/activitypub/objects/index.ts b/packages/models/src/activitypub/objects/index.ts index 510f621ea..8e21f584f 100644 --- a/packages/models/src/activitypub/objects/index.ts +++ b/packages/models/src/activitypub/objects/index.ts | |||
@@ -4,6 +4,7 @@ export * from './cache-file-object.js' | |||
4 | export * from './common-objects.js' | 4 | export * from './common-objects.js' |
5 | export * from './playlist-element-object.js' | 5 | export * from './playlist-element-object.js' |
6 | export * from './playlist-object.js' | 6 | export * from './playlist-object.js' |
7 | export * from './video-chapters-object.js' | ||
7 | export * from './video-comment-object.js' | 8 | export * from './video-comment-object.js' |
8 | export * from './video-object.js' | 9 | export * from './video-object.js' |
9 | export * from './watch-action-object.js' | 10 | export * from './watch-action-object.js' |
diff --git a/packages/models/src/activitypub/objects/video-chapters-object.ts b/packages/models/src/activitypub/objects/video-chapters-object.ts new file mode 100644 index 000000000..0149c6e87 --- /dev/null +++ b/packages/models/src/activitypub/objects/video-chapters-object.ts | |||
@@ -0,0 +1,11 @@ | |||
1 | export interface VideoChaptersObject { | ||
2 | id: string | ||
3 | hasPart: VideoChapterObject[] | ||
4 | } | ||
5 | |||
6 | // Same as https://schema.org/hasPart | ||
7 | export interface VideoChapterObject { | ||
8 | name: string | ||
9 | startOffset: number | ||
10 | endOffset: number | ||
11 | } | ||
diff --git a/packages/models/src/activitypub/objects/video-object.ts b/packages/models/src/activitypub/objects/video-object.ts index 14afd85a2..9abae6a39 100644 --- a/packages/models/src/activitypub/objects/video-object.ts +++ b/packages/models/src/activitypub/objects/video-object.ts | |||
@@ -50,6 +50,7 @@ export interface VideoObject { | |||
50 | dislikes: string | 50 | dislikes: string |
51 | shares: string | 51 | shares: string |
52 | comments: string | 52 | comments: string |
53 | hasParts: string | ||
53 | 54 | ||
54 | attributedTo: ActivityPubAttributedTo[] | 55 | attributedTo: ActivityPubAttributedTo[] |
55 | 56 | ||
diff --git a/packages/models/src/videos/chapter/chapter-update.model.ts b/packages/models/src/videos/chapter/chapter-update.model.ts new file mode 100644 index 000000000..82b2091af --- /dev/null +++ b/packages/models/src/videos/chapter/chapter-update.model.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export interface VideoChapterUpdate { | ||
2 | chapters: { | ||
3 | timecode: number | ||
4 | title: string | ||
5 | }[] | ||
6 | } | ||
diff --git a/packages/models/src/videos/chapter/chapter.model.ts b/packages/models/src/videos/chapter/chapter.model.ts new file mode 100644 index 000000000..7ecba61bc --- /dev/null +++ b/packages/models/src/videos/chapter/chapter.model.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export interface VideoChapter { | ||
2 | timecode: number | ||
3 | title: string | ||
4 | } | ||
diff --git a/packages/models/src/videos/chapter/index.ts b/packages/models/src/videos/chapter/index.ts new file mode 100644 index 000000000..15fca476f --- /dev/null +++ b/packages/models/src/videos/chapter/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './chapter-update.model.js' | ||
2 | export * from './chapter.model.js' | ||
diff --git a/packages/models/src/videos/index.ts b/packages/models/src/videos/index.ts index d131212c9..7d96d31a6 100644 --- a/packages/models/src/videos/index.ts +++ b/packages/models/src/videos/index.ts | |||
@@ -12,6 +12,7 @@ export * from './rate/index.js' | |||
12 | export * from './stats/index.js' | 12 | export * from './stats/index.js' |
13 | export * from './transcoding/index.js' | 13 | export * from './transcoding/index.js' |
14 | export * from './channel-sync/index.js' | 14 | export * from './channel-sync/index.js' |
15 | export * from './chapter/index.js' | ||
15 | 16 | ||
16 | export * from './nsfw-policy.type.js' | 17 | export * from './nsfw-policy.type.js' |
17 | 18 | ||