1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2025-01-08 18:40:28 +05:30

feat: option to autoplay playlist only (#3767)

This commit is contained in:
ac615223s5 2025-01-07 03:48:46 -08:00 committed by GitHub
parent b39574af62
commit d49efa08c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -212,7 +212,11 @@
<input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" />
<br />
<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 />
@ -424,7 +428,7 @@ export default {
},
activated() {
this.active = true;
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false);
this.selectedAutoPlay = this.getPreferenceNumber("autoplay", 1);
this.showComments = !this.getPreferenceBoolean("minimizeComments", false);
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", true);
this.showRecs = !this.getPreferenceBoolean("minimizeRecommendations", false);
@ -623,8 +627,8 @@ export default {
onVideoEnded() {
if (
!this.selectedAutoLoop &&
this.selectedAutoPlay &&
(this.playlist?.relatedStreams?.length > 0 || this.video.relatedStreams.length > 0)
((this.selectedAutoPlay >= 1 && this.playlist?.relatedStreams?.length > this.index) ||
(this.selectedAutoPlay >= 2 && this.video.relatedStreams.length > 0))
) {
this.showToast();
}