diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-11 12:04:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-11 13:33:11 +0200 |
commit | 428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba (patch) | |
tree | b75329b64f5e201abdfb39961f2db09a08292b77 /shared/models/plugins/server/managers | |
parent | 2b02c520e66ea452687cab39401b371711caa9ed (diff) | |
download | PeerTube-428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba.tar.gz PeerTube-428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba.tar.zst PeerTube-428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba.zip |
Reorganize plugin models
Diffstat (limited to 'shared/models/plugins/server/managers')
9 files changed, 68 insertions, 0 deletions
diff --git a/shared/models/plugins/server/managers/index.ts b/shared/models/plugins/server/managers/index.ts new file mode 100644 index 000000000..49365a854 --- /dev/null +++ b/shared/models/plugins/server/managers/index.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | |||
2 | export * from './plugin-playlist-privacy-manager.model' | ||
3 | export * from './plugin-settings-manager.model' | ||
4 | export * from './plugin-storage-manager.model' | ||
5 | export * from './plugin-transcoding-manager.model' | ||
6 | export * from './plugin-video-category-manager.model' | ||
7 | export * from './plugin-video-language-manager.model' | ||
8 | export * from './plugin-video-licence-manager.model' | ||
9 | export * from './plugin-video-privacy-manager.model' | ||
diff --git a/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts new file mode 100644 index 000000000..4703c0a8b --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts | |||
@@ -0,0 +1,8 @@ | |||
1 | import { VideoPlaylistPrivacy } from '../../../videos/playlist/video-playlist-privacy.model' | ||
2 | |||
3 | export interface PluginPlaylistPrivacyManager { | ||
4 | // PUBLIC = 1, | ||
5 | // UNLISTED = 2, | ||
6 | // PRIVATE = 3 | ||
7 | deletePlaylistPrivacy: (privacyKey: VideoPlaylistPrivacy) => boolean | ||
8 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-settings-manager.model.ts b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts new file mode 100644 index 000000000..3c28c0565 --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | export interface PluginSettingsManager { | ||
2 | getSetting: (name: string) => Promise<string | boolean> | ||
3 | |||
4 | getSettings: (names: string[]) => Promise<{ [settingName: string]: string | boolean }> | ||
5 | |||
6 | setSetting: (name: string, value: string) => Promise<any> | ||
7 | |||
8 | onSettingsChange: (cb: (names: string[]) => Promise<any>) => void | ||
9 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-storage-manager.model.ts b/shared/models/plugins/server/managers/plugin-storage-manager.model.ts new file mode 100644 index 000000000..51567044a --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-storage-manager.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface PluginStorageManager { | ||
2 | getData: (key: string) => Promise<string> | ||
3 | |||
4 | storeData: (key: string, data: any) => Promise<any> | ||
5 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts b/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts new file mode 100644 index 000000000..a0422a460 --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | import { EncoderOptionsBuilder } from '../../../videos/video-transcoding.model' | ||
2 | |||
3 | export interface PluginTranscodingManager { | ||
4 | addLiveProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean | ||
5 | |||
6 | addVODProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean | ||
7 | |||
8 | addLiveEncoderPriority (streamType: 'audio' | 'video', encoder: string, priority: number): void | ||
9 | |||
10 | addVODEncoderPriority (streamType: 'audio' | 'video', encoder: string, priority: number): void | ||
11 | |||
12 | removeAllProfilesAndEncoderPriorities(): void | ||
13 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts new file mode 100644 index 000000000..201bfa979 --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface PluginVideoCategoryManager { | ||
2 | addCategory: (categoryKey: number, categoryLabel: string) => boolean | ||
3 | |||
4 | deleteCategory: (categoryKey: number) => boolean | ||
5 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts new file mode 100644 index 000000000..3fd577a79 --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface PluginVideoLanguageManager { | ||
2 | addLanguage: (languageKey: string, languageLabel: string) => boolean | ||
3 | |||
4 | deleteLanguage: (languageKey: string) => boolean | ||
5 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts new file mode 100644 index 000000000..82a634d3a --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface PluginVideoLicenceManager { | ||
2 | addLicence: (licenceKey: number, licenceLabel: string) => boolean | ||
3 | |||
4 | deleteLicence: (licenceKey: number) => boolean | ||
5 | } | ||
diff --git a/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts new file mode 100644 index 000000000..7717115e3 --- /dev/null +++ b/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | import { VideoPrivacy } from '../../../videos/video-privacy.enum' | ||
2 | |||
3 | export interface PluginVideoPrivacyManager { | ||
4 | // PUBLIC = 1 | ||
5 | // UNLISTED = 2 | ||
6 | // PRIVATE = 3 | ||
7 | // INTERNAL = 4 | ||
8 | deletePrivacy: (privacyKey: VideoPrivacy) => boolean | ||
9 | } | ||