option to autoplay playlist only

This commit is contained in:
nieve 2024-08-28 01:13:53 -04:00
parent 647f4132a6
commit 1376850dbe

View File

@ -212,7 +212,11 @@
<input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" /> <input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" />
<br /> <br />
<label for="chkAutoPlay"><strong v-text="`${$t('actions.auto_play_next_video')}:`" /></label> <label for="chkAutoPlay"><strong v-text="`${$t('actions.auto_play_next_video')}:`" /></label>
<input id="chkAutoPlay" v-model="selectedAutoPlay" class="ml-1.5" type="checkbox" @change="onChange($event)" /> <select id="chkAutoPlay" v-model="selectedAutoPlay" class="ml-1.5 select" @change="onChange($event)">
<option value="0">none</option>
<option value="1">playlist only</option>
<option value="2">playlist and recommendations</option>
</select>
<hr /> <hr />
@ -424,7 +428,7 @@ export default {
}, },
activated() { activated() {
this.active = true; this.active = true;
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false); this.selectedAutoPlay = this.getPreferenceNumber("autoplay", 1);
this.showComments = !this.getPreferenceBoolean("minimizeComments", false); this.showComments = !this.getPreferenceBoolean("minimizeComments", false);
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", true); this.showDesc = !this.getPreferenceBoolean("minimizeDescription", true);
this.showRecs = !this.getPreferenceBoolean("minimizeRecommendations", false); this.showRecs = !this.getPreferenceBoolean("minimizeRecommendations", false);
@ -623,8 +627,8 @@ export default {
onVideoEnded() { onVideoEnded() {
if ( if (
!this.selectedAutoLoop && !this.selectedAutoLoop &&
this.selectedAutoPlay && ((this.selectedAutoPlay >= 1 && this.playlist?.relatedStreams?.length > this.index) ||
(this.playlist?.relatedStreams?.length > 0 || this.video.relatedStreams.length > 0) (this.selectedAutoPlay >= 2 && this.video.relatedStreams.length > 0))
) { ) {
this.showToast(); this.showToast();
} }