From 9cac0d4ffc932fe18a0ca670ccb3d949e405b536 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 28 Mar 2026 15:46:52 +0100 Subject: [PATCH] feat(video-player): update sidebar width and simplify active view logic --- .../video-player/video-player.component.html | 4 +- .../video-player/video-player.component.ts | 62 ++----------------- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.html b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.html index ce4da1f6d..189343fc2 100644 --- a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.html +++ b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.html @@ -3,8 +3,8 @@ appResizable [minWidth]="200" [maxWidth]="600" - [defaultWidth]="350" - storageKey="sidebar-width" + [defaultWidth]="460" + storageKey="m3u-sidebar-width" > @defer { { - if (this.router.url.includes('/workspace/global-favorites')) { - return 'favorites'; - } - return params['view'] || 'all'; - }) - ), - { - initialValue: this.router.url.includes( - '/workspace/global-favorites' - ) - ? 'favorites' - : 'all', - } + this.activatedRoute.params.pipe(map((params) => params['view'] || 'all')), + { initialValue: 'all' } ); /** Selected video player options */ @@ -182,13 +169,8 @@ export class VideoPlayerComponent implements OnInit, OnDestroy { effect(() => { const playlistId = this.activePlaylistId(); const activeChannel = this.activeChannel(); - const currentUrl = this.router.url; - if ( - !playlistId || - !activeChannel?.url || - currentUrl.includes('/workspace/global-favorites') - ) { + if (!playlistId || !activeChannel?.url) { return; } @@ -294,43 +276,7 @@ export class VideoPlayerComponent implements OnInit, OnDestroy { distinctUntilChanged((prev, curr) => prev['id'] === curr['id']), combineLatestWith(this.activatedRoute.queryParams), switchMap(([params]) => { - const isGlobalFavorites = this.router.url.includes( - '/workspace/global-favorites' - ); - - if (isGlobalFavorites) { - this.store.dispatch( - ChannelActions.resetActiveChannel() - ); - this.store.dispatch( - PlaylistActions.setActivePlaylist({ - playlistId: '', - }) - ); - return this.playlistsService - .getPlaylistWithGlobalFavorites() - .pipe( - map((playlist) => { - this.store.dispatch( - ChannelActions.setChannels({ - channels: playlist.playlist.items, - }) - ); - - const stringFavs = ( - playlist.favorites ?? [] - ).filter( - (f): f is string => - typeof f === 'string' - ); - this.store.dispatch( - FavoritesActions.setFavorites({ - channelIds: stringFavs, - }) - ); - }) - ); - } else if (params['id']) { + if (params['id']) { this.store.dispatch( ChannelActions.resetActiveChannel() );