diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-10-24 14:48:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 14:48:03 +0200 |
commit | 38a3ccc7f8ad0ea94362b58c732af7c387ab46be (patch) | |
tree | ccbd200c4b95d0fcfa56b7d5fc3c9490887187b1 /client/src/app/shared/shared-video-miniature | |
parent | 01a3c07a7913891d4830797403b3865d53f0af61 (diff) | |
download | PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.tar.gz PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.tar.zst PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.zip |
feat: show contained playlists under My videos (#5125)
* feat: show contained playlists under My videos
closes #4769
* refactor(server): remove unused types
* fixes after code review
* fix(client/video-miniature): add to playlist
* fix(server/user/me): shortUUID response
* Revert "fix(client/video-miniature): add to playlist"
This reverts commit f1a0412391c7e2370b87df2594c9fe3f39a40ddc.
* fix(client/PlaylistService): caching
* Revert "fix(server/user/me): shortUUID response"
This reverts commit e3f1ee4e335739b895bced938540c003df24af73.
* Fix fetching playlists
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
5 files changed, 15 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html index e8d2ca1c4..6fdf24b2d 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html | |||
@@ -52,6 +52,12 @@ | |||
52 | <ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container> | 52 | <ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container> |
53 | <ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container> | 53 | <ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container> |
54 | </div> | 54 | </div> |
55 | |||
56 | <div *ngIf="containedInPlaylists" class="video-contained-in-playlists"> | ||
57 | <a *ngFor="let playlist of containedInPlaylists" class="chip rectangular bg-secondary text-light" [routerLink]="['/w/p/', playlist.playlistShortUUID]"> | ||
58 | {{ playlist.playlistDisplayName }} | ||
59 | </a> | ||
60 | </div> | ||
55 | </div> | 61 | </div> |
56 | </div> | 62 | </div> |
57 | 63 | ||
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss index a397efdca..ba2adfc5a 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss | |||
@@ -4,6 +4,10 @@ | |||
4 | 4 | ||
5 | $more-button-width: 40px; | 5 | $more-button-width: 40px; |
6 | 6 | ||
7 | .chip { | ||
8 | @include chip; | ||
9 | } | ||
10 | |||
7 | .video-miniature { | 11 | .video-miniature { |
8 | font-size: 14px; | 12 | font-size: 14px; |
9 | } | 13 | } |
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index 20596d6d0..85c63c173 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts | |||
@@ -11,7 +11,7 @@ import { | |||
11 | Output | 11 | Output |
12 | } from '@angular/core' | 12 | } from '@angular/core' |
13 | import { AuthService, ScreenService, ServerService, User } from '@app/core' | 13 | import { AuthService, ScreenService, ServerService, User } from '@app/core' |
14 | import { HTMLServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models' | 14 | import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models' |
15 | import { LinkType } from '../../../types/link.type' | 15 | import { LinkType } from '../../../types/link.type' |
16 | import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component' | 16 | import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component' |
17 | import { Video } from '../shared-main' | 17 | import { Video } from '../shared-main' |
@@ -40,6 +40,7 @@ export type MiniatureDisplayOptions = { | |||
40 | export class VideoMiniatureComponent implements OnInit { | 40 | export class VideoMiniatureComponent implements OnInit { |
41 | @Input() user: User | 41 | @Input() user: User |
42 | @Input() video: Video | 42 | @Input() video: Video |
43 | @Input() containedInPlaylists: VideoExistInPlaylist[] | ||
43 | 44 | ||
44 | @Input() displayOptions: MiniatureDisplayOptions = { | 45 | @Input() displayOptions: MiniatureDisplayOptions = { |
45 | date: true, | 46 | date: true, |
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html index 6ea2661e4..6c6db4b96 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.html +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html | |||
@@ -12,6 +12,7 @@ | |||
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <my-video-miniature | 14 | <my-video-miniature |
15 | [containedInPlaylists]="videosContainedInPlaylists ? videosContainedInPlaylists[video.id] : undefined" | ||
15 | [video]="video" [displayAsRow]="true" [displayOptions]="miniatureDisplayOptions" | 16 | [video]="video" [displayAsRow]="true" [displayOptions]="miniatureDisplayOptions" |
16 | [displayVideoActions]="false" [user]="user" | 17 | [displayVideoActions]="false" [user]="user" |
17 | ></my-video-miniature> | 18 | ></my-video-miniature> |
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts index fa3c79bbb..460a0080e 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts | |||
@@ -2,7 +2,7 @@ import { Observable, Subject } from 'rxjs' | |||
2 | import { AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef } from '@angular/core' | 2 | import { AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef } from '@angular/core' |
3 | import { ComponentPagination, Notifier, User } from '@app/core' | 3 | import { ComponentPagination, Notifier, User } from '@app/core' |
4 | import { logger } from '@root-helpers/logger' | 4 | import { logger } from '@root-helpers/logger' |
5 | import { ResultList, VideoSortField } from '@shared/models' | 5 | import { ResultList, VideosExistInPlaylists, VideoSortField } from '@shared/models' |
6 | import { PeerTubeTemplateDirective, Video } from '../shared-main' | 6 | import { PeerTubeTemplateDirective, Video } from '../shared-main' |
7 | import { MiniatureDisplayOptions } from './video-miniature.component' | 7 | import { MiniatureDisplayOptions } from './video-miniature.component' |
8 | 8 | ||
@@ -14,6 +14,7 @@ export type SelectionType = { [ id: number ]: boolean } | |||
14 | styleUrls: [ './videos-selection.component.scss' ] | 14 | styleUrls: [ './videos-selection.component.scss' ] |
15 | }) | 15 | }) |
16 | export class VideosSelectionComponent implements AfterContentInit { | 16 | export class VideosSelectionComponent implements AfterContentInit { |
17 | @Input() videosContainedInPlaylists: VideosExistInPlaylists | ||
17 | @Input() user: User | 18 | @Input() user: User |
18 | @Input() pagination: ComponentPagination | 19 | @Input() pagination: ComponentPagination |
19 | 20 | ||