Skip to content

Commit

Permalink
$ Name props/emits better
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Dec 21, 2024
1 parent 0620083 commit 1c90248
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
class="autoPlayToggle"
:label="$t('Video.Autoplay')"
:compact="true"
:default-value="playNextRecommendedVideo"
@change="updatePlayNextVideo"
:default-value="autoplayNextRecommendedVideo"
@change="updateAutoplayNextVideo"
/>
</div>
<FtListVideoLazy
Expand Down Expand Up @@ -40,19 +40,19 @@ defineProps({
type: Boolean,
default: false
},
playNextRecommendedVideo: {
autoplayNextRecommendedVideo: {
type: Boolean,
required: true
},
})
const emit = defineEmits(['play-next-recommended-video-update'])
const emit = defineEmits(['autoplay-next-recommended-video-update'])
/**
* @param {boolean} value
*/
function updatePlayNextVideo(value) {
emit('play-next-recommended-video-update', value)
function updateAutoplayNextVideo(value) {
emit('autoplay-next-recommended-video-update', value)
}
</script>

Expand Down
8 changes: 4 additions & 4 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default defineComponent({
captions: [],
/** @type {'EQUIRECTANGULAR' | 'EQUIRECTANGULAR_THREED_TOP_BOTTOM' | 'MESH'| null} */
vrProjection: null,
playNextRecommendedVideo: false,
autoplayNextRecommendedVideo: false,
autoplayPlaylists: false,
recommendedVideos: [],
downloadLinks: [],
Expand Down Expand Up @@ -181,7 +181,7 @@ export default defineComponent({
thumbnailPreference: function () {
return this.$store.getters.getThumbnailPreference
},
playNextRecommendedVideoByDefault: function () {
autoplayNextRecommendedVideoByDefault: function () {
return this.$store.getters.getPlayNextVideo
},
autoplayPlaylistsByDefault: function () {
Expand Down Expand Up @@ -305,7 +305,7 @@ export default defineComponent({
this.videoId = this.$route.params.id
this.activeFormat = this.defaultVideoFormat
// So that the value for this session remains unchanged even if setting changed
this.playNextRecommendedVideo = this.playNextRecommendedVideoByDefault
this.autoplayNextRecommendedVideo = this.autoplayNextRecommendedVideoByDefault
this.autoplayPlaylists = this.autoplayPlaylistsByDefault

this.checkIfTimestamp()
Expand Down Expand Up @@ -1247,7 +1247,7 @@ export default defineComponent({
},

handleVideoEnded: function () {
if ((!this.watchingPlaylist || !this.autoplayPlaylists) && !this.playNextRecommendedVideo) {
if ((!this.watchingPlaylist || !this.autoplayPlaylists) && !this.autoplayNextRecommendedVideo) {
return
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/views/Watch/Watch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@
v-if="!isLoading && !hideRecommendedVideos"
:show-autoplay="!watchingPlaylist"
:data="recommendedVideos"
:play-next-recommended-video="playNextRecommendedVideo"
:autoplay-next-recommended-video="autoplayNextRecommendedVideo"
class="watchVideoSideBar watchVideoRecommendations"
:class="{
theatreRecommendations: useTheatreMode,
watchVideoRecommendationsLowerCard: watchingPlaylist || isLive,
watchVideoRecommendationsNoCard: !watchingPlaylist || !isLive
}"
@play-next-recommended-video-update="(v) => playNextRecommendedVideo = v"
@autoplay-next-recommended-video-update="(v) => autoplayNextRecommendedVideo = v"
/>
</div>
</div>
Expand Down

0 comments on commit 1c90248

Please sign in to comment.