From 951b582f52d0694865f020f0e53ccfad2d2d6033 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Aug 2020 13:43:48 +0200 Subject: [PATCH] Add ability to share playlists in modal --- .../video-block-list.component.ts | 4 +- .../comment/video-comment.component.ts | 2 +- .../modal/video-share.component.html | 52 +++++++++++++--- .../modal/video-share.component.ts | 41 ++++++++++--- .../+video-watch/video-watch.component.ts | 2 +- .../abuse-list-table.component.ts | 4 +- .../report-modals/video-report.component.ts | 4 +- .../video-playlist.model.ts | 8 ++- .../assets/player/peertube-player-manager.ts | 4 +- client/src/assets/player/utils.ts | 59 ++++++++++++++----- server/models/video/video-playlist.ts | 1 + server/tests/api/videos/video-playlists.ts | 3 +- .../videos/playlist/video-playlist.model.ts | 2 + 13 files changed, 143 insertions(+), 43 deletions(-) diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index 3242bcf46..422d873c0 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts @@ -7,7 +7,7 @@ import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { VideoBlockService } from '@app/shared/shared-moderation' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoBlacklist, VideoBlacklistType } from '@shared/models' -import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' +import { buildVideoOrPlaylistEmbed, buildVideoLink } from 'src/assets/player/utils' import { environment } from 'src/environments/environment' import { DomSanitizer } from '@angular/platform-browser' @@ -176,7 +176,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV } getVideoEmbed (entry: VideoBlacklist) { - return buildVideoEmbed( + return buildVideoOrPlaylistEmbed( buildVideoLink({ baseUrl: `${environment.embedUrl}/videos/embed/${entry.video.uuid}`, title: false, diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts index 6744a0954..36ec6e9f9 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts @@ -135,7 +135,7 @@ export class VideoCommentComponent implements OnInit, OnChanges { this.comment.account = null } - if (this.isUserLoggedIn() && this.authService.getUser().account.id !== this.comment.account.id) { + if (this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id) { this.prependModerationActions = [ { label: this.i18n('Report comment'), diff --git a/client/src/app/+videos/+video-watch/modal/video-share.component.html b/client/src/app/+videos/+video-watch/modal/video-share.component.html index 71ae6544f..946e8d8ca 100644 --- a/client/src/app/+videos/+video-watch/modal/video-share.component.html +++ b/client/src/app/+videos/+video-watch/modal/video-share.component.html @@ -6,18 +6,56 @@