Skip to content

Commit

Permalink
* Make remove watched videos button visible when any video watched
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Jun 1, 2024
1 parent 857e22d commit bf8d142
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ export default defineComponent({
return this.isUserPlaylist ? 'user' : ''
},

userPlaylistAnyVideoWatched() {
if (!this.isUserPlaylist) { return false }

const historyCacheById = this.$store.getters.getHistoryCacheById
return this.selectedUserPlaylist.videos.some((video) => {
return typeof historyCacheById[video.videoId] !== 'undefined'
})
},

userPlaylistUniqueVideoIds() {
if (!this.isUserPlaylist) { return new Set() }

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/playlist-info/playlist-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@
@click="toggleCopyVideosPrompt"
/>
<ft-icon-button
v-if="!editMode && isUserPlaylist && userPlaylistDuplicateItemCount > 0"
v-if="!editMode && userPlaylistDuplicateItemCount > 0"
:title="$t('User Playlists.Remove Duplicate Videos')"
:icon="['fas', 'video-slash']"
theme="destructive"
@click="showRemoveDuplicateVideosPrompt = true"
/>
<ft-icon-button
v-if="!editMode && isUserPlaylist && videoCount > 0"
v-if="!editMode && userPlaylistAnyVideoWatched"
:title="$t('User Playlists.Remove Watched Videos')"
:icon="['fas', 'eye-slash']"
theme="destructive"
Expand Down

0 comments on commit bf8d142

Please sign in to comment.