From 05a60d85997c108d39bcfb14f1ffd4c74f8b1e93 Mon Sep 17 00:00:00 2001 From: Wicklow <123956049+wickloww@users.noreply.github.com> Date: Fri, 31 Mar 2023 07:12:21 +0000 Subject: Feature/Add replay privacy (#5692) * Add replay settings feature * Fix replay settings behaviour * Fix tests * Fix tests * Fix tests * Update openapi doc and fix tests * Add tests and fix code * Models correction * Add migration and update controller and middleware * Add check params tests * Fix video live middleware * Updated code based on review comments --- .../+video-edit/shared/video-edit.component.html | 9 +- .../+video-edit/shared/video-edit.component.ts | 9 +- .../video-go-live.component.ts | 14 +- .../+videos/+video-edit/video-update.component.ts | 2 + server/controllers/api/videos/live.ts | 38 ++- server/initializers/constants.ts | 2 +- server/initializers/database.ts | 2 + .../migrations/0760-video-live-replay-setting.ts | 125 ++++++++++ server/lib/job-queue/handlers/video-live-ending.ts | 15 +- server/lib/live/live-manager.ts | 33 ++- server/middlewares/validators/videos/video-live.ts | 54 ++++- .../sql/video/shared/video-table-attributes.ts | 1 + server/models/video/video-live-replay-setting.ts | 42 ++++ server/models/video/video-live-session.ts | 49 +++- server/models/video/video-live.ts | 57 ++++- server/models/video/video.ts | 1 + server/tests/api/check-params/live.ts | 47 +++- server/tests/api/live/live-constraints.ts | 6 +- server/tests/api/live/live-fast-restream.ts | 1 + server/tests/api/live/live-save-replay.ts | 264 +++++++++++++++------ server/tests/api/live/live.ts | 13 +- .../tests/api/notifications/user-notifications.ts | 2 + server/tests/api/object-storage/live.ts | 1 + .../object-storage/video-static-file-privacy.ts | 12 +- .../tests/api/videos/video-static-file-privacy.ts | 12 +- server/types/express.d.ts | 6 +- server/types/models/video/index.ts | 1 + .../models/video/video-live-replay-setting.ts | 3 + server/types/models/video/video-live-session.ts | 6 +- server/types/models/video/video-live.ts | 9 +- .../models/videos/live/live-video-create.model.ts | 2 + .../models/videos/live/live-video-session.model.ts | 3 + .../models/videos/live/live-video-update.model.ts | 2 + shared/models/videos/live/live-video.model.ts | 2 + shared/server-commands/videos/live-command.ts | 1 + support/doc/api/openapi.yaml | 20 +- 36 files changed, 746 insertions(+), 120 deletions(-) create mode 100644 server/initializers/migrations/0760-video-live-replay-setting.ts create mode 100644 server/models/video/video-live-replay-setting.ts create mode 100644 server/types/models/video/video-live-replay-setting.ts diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html index fdd6b2311..b0da84979 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html @@ -272,7 +272,7 @@ -