mirror of https://github.com/FreeTubeApp/FreeTube
Merge cf06607fbe
into a62c8329e5
This commit is contained in:
commit
86f668e0e3
|
@ -76,10 +76,33 @@ export default defineComponent({
|
|||
count: this.loneVideoPresenceCountInPlaylist,
|
||||
})
|
||||
},
|
||||
multiVideoPresenceCountInPlaylist() {
|
||||
if (this.toBeAddedToPlaylistVideoList.length < 2) { return null }
|
||||
|
||||
// Count of to be added videos already present in this playlist
|
||||
const v = this.toBeAddedToPlaylistVideoList.reduce((accumulator, toBeAddedToVideo) => {
|
||||
return this.playlist.videos.some((pv) => pv.videoId === toBeAddedToVideo.videoId)
|
||||
? accumulator + 1
|
||||
: accumulator
|
||||
}, 0)
|
||||
// Don't display zero value
|
||||
return v === 0 ? null : v
|
||||
},
|
||||
multiVideoPresenceCountInPlaylistText() {
|
||||
if (this.multiVideoPresenceCountInPlaylist == null) { return null }
|
||||
|
||||
return this.$tc('User Playlists.AddVideoPrompt.{videoCount}/{totalVideoCount} Videos Already Added', this.multiVideoPresenceCountInPlaylist, {
|
||||
videoCount: this.multiVideoPresenceCountInPlaylist,
|
||||
totalVideoCount: this.toBeAddedToPlaylistVideoList.length,
|
||||
})
|
||||
},
|
||||
videoPresenceCountInPlaylistText() {
|
||||
return this.loneVideoPresenceCountInPlaylistText ?? this.multiVideoPresenceCountInPlaylistText
|
||||
},
|
||||
videoPresenceCountInPlaylistTextVisible() {
|
||||
if (!this.videoPresenceCountInPlaylistTextShouldBeVisible) { return false }
|
||||
|
||||
return this.loneVideoPresenceCountInPlaylistText != null
|
||||
return this.videoPresenceCountInPlaylistText != null
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
v-if="videoPresenceCountInPlaylistTextVisible"
|
||||
class="videoPresenceCount"
|
||||
>
|
||||
{{ loneVideoPresenceCountInPlaylistText }}
|
||||
{{ videoPresenceCountInPlaylistText }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -218,6 +218,7 @@ User Playlists:
|
|||
Save: Save
|
||||
|
||||
Added {count} Times: 'Added {count} Time | Added {count} Times'
|
||||
"{videoCount}/{totalVideoCount} Videos Already Added": '{videoCount}/{totalVideoCount} Video Already Added | {videoCount}/{totalVideoCount} Videos Already Added'
|
||||
|
||||
Toast:
|
||||
You haven't selected any playlist yet.: You haven't selected any playlist yet.
|
||||
|
|
Loading…
Reference in New Issue