From bcd6081b37fa81fb4c8b622a7c7cce777d19569b Mon Sep 17 00:00:00 2001 From: vdbhb59 <60728004+vdbhb59@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:31:45 +0000 Subject: [PATCH] Add button to pause playlist after current video (FreeTubeApp#3938) Rounded playlist buttons to circles Add pause button for playlists --- src/renderer/views/Watch/Watch.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 1f7a0b467d525..cd46a97b12cce 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -183,7 +183,7 @@ export default defineComponent({ hideVideoDescription: function () { return this.$store.getters.getHideVideoDescription }, - showFamilyFriendlyOnly: function() { + showFamilyFriendlyOnly: function () { return this.$store.getters.getShowFamilyFriendlyOnly }, hideChannelSubscriptions: function () { @@ -1143,6 +1143,10 @@ export default defineComponent({ }, checkIfPlaylist: function () { + // On the off chance that user selected pause on current video + // Then clicks on another video in the playlist + this.disablePlaylistPauseOnCurrent() + if (typeof (this.$route.query) !== 'undefined') { this.playlistId = this.$route.query.playlistId @@ -1274,6 +1278,11 @@ export default defineComponent({ return } + if (this.watchingPlaylist && this.getPlaylistPauseOnCurrent()) { + this.disablePlaylistPauseOnCurrent() + return + } + if (this.watchingPlaylist && this.$refs.watchVideoPlaylist.shouldStopDueToPlaylistEnd) { // Let `watchVideoPlaylist` handle end of playlist, no countdown needed this.$refs.watchVideoPlaylist.playNextVideo() @@ -1458,7 +1467,7 @@ export default defineComponent({ ] }, - getAdaptiveFormatsInvidious: async function(existingInfoResult = null) { + getAdaptiveFormatsInvidious: async function (existingInfoResult = null) { let result if (existingInfoResult) { result = existingInfoResult @@ -1627,6 +1636,16 @@ export default defineComponent({ return this.$refs.watchVideoPlaylist ? this.$refs.watchVideoPlaylist.loopEnabled : false }, + getPlaylistPauseOnCurrent: function () { + return this.$refs.watchVideoPlaylist ? this.$refs.watchVideoPlaylist.pauseOnCurrentVideo : false + }, + + disablePlaylistPauseOnCurrent: function () { + if (this.$refs.watchVideoPlaylist) { + this.$refs.watchVideoPlaylist.pauseOnCurrentVideo = false + } + }, + updateTitle: function () { document.title = `${this.videoTitle} - FreeTube` },