fixes after code review

This commit is contained in:
kontrollanten 2022-08-09 14:49:27 +02:00
parent 38c55ffebd
commit 606fd8925e
4 changed files with 4 additions and 11 deletions

View File

@ -37,7 +37,6 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
totalItems: null
}
miniatureDisplayOptions: MiniatureDisplayOptions = {
containedInPlaylists: true,
date: true,
views: true,
by: true,
@ -102,7 +101,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
}
this.getVideosObservable(this.pagination.currentPage)
.pipe(switchMap(({ data }) => this.playlistService.listPlaylistsForVideos(data.map(v => v.id))))
.pipe(switchMap(({ data }) => this.playlistService.doVideosExistInPlaylist(data.map(v => v.id))))
.subscribe(result => {
this.videosContainedInPlaylists = Object.keys(result).reduce((acc, videoId) => ({
...acc,

View File

@ -53,8 +53,8 @@
<ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container>
</div>
<div *ngIf="displayOptions.containedInPlaylists" class="video-contained-in-playlists">
<a *ngFor="let playlist of containedInPlaylists" class="chip rectangular bg-secondary text-light" [routerLink]="['/w/p/', playlist.playlistShortUUID]" i18n>
<div *ngIf="containedInPlaylists" class="video-contained-in-playlists">
<a *ngFor="let playlist of containedInPlaylists" class="chip rectangular bg-secondary text-light" [routerLink]="['/w/p/', playlist.playlistShortUUID]">
{{ playlist.playlistDisplayName }}
</a>
</div>

View File

@ -19,7 +19,6 @@ import { VideoPlaylistService } from '../shared-video-playlist'
import { VideoActionsDisplayType } from './video-actions-dropdown.component'
export type MiniatureDisplayOptions = {
containedInPlaylists?: boolean
date?: boolean
views?: boolean
by?: boolean
@ -42,7 +41,6 @@ export class VideoMiniatureComponent implements OnInit {
@Input() containedInPlaylists: VideoExistInPlaylist[]
@Input() displayOptions: MiniatureDisplayOptions = {
containedInPlaylists: false,
date: true,
views: true,
by: true,

View File

@ -83,10 +83,6 @@ export class VideoPlaylistService {
)
}
listPlaylistsForVideos (videoIds: number[]) {
return this.doVideosExistInPlaylist(videoIds)
}
listMyPlaylistWithCache (user: AuthUser, search?: string) {
if (!search) {
if (this.myAccountPlaylistCacheRunning) return this.myAccountPlaylistCacheRunning
@ -342,7 +338,7 @@ export class VideoPlaylistService {
)
}
private doVideosExistInPlaylist (videoIds: number[]): Observable<VideosExistInPlaylists> {
doVideosExistInPlaylist (videoIds: number[]): Observable<VideosExistInPlaylists> {
const url = VideoPlaylistService.MY_VIDEO_PLAYLIST_URL + 'videos-exist'
let params = new HttpParams()