fix: show watched icon only for individual watched videos instead of checking overall watched list

This commit is contained in:
Chneemann 2025-05-14 19:29:24 +02:00
parent 26e34a2dfc
commit 7a277f65b4
2 changed files with 1 additions and 11 deletions

View file

@ -9,7 +9,7 @@
alt="" alt=""
/> />
</div> </div>
@if (getWatchedVideos()) { @if (watchedVideos.includes(video.id)) {
<div class="watched"> <div class="watched">
<img src="./assets/img/open-eye.svg" alt="" /> <img src="./assets/img/open-eye.svg" alt="" />
</div> </div>

View file

@ -29,16 +29,6 @@ export class VideoListComponent {
return `${environment.baseUrl}/media/thumbnails/${id}/${fileName}_480p.jpg`; return `${environment.baseUrl}/media/thumbnails/${id}/${fileName}_480p.jpg`;
} }
/**
* Filters and returns all watched videos.
* @returns An array of watched videos.
*/
getWatchedVideos(): Video[] {
return this.videos.filter(
(video) => video.id !== undefined && this.watchedVideos.includes(video.id)
);
}
/** /**
* Set the current video based on the given videoId and emit the videoId. * Set the current video based on the given videoId and emit the videoId.
* @param videoId The id of the video to set as the current video. * @param videoId The id of the video to set as the current video.