Skip to content

Commit

Permalink
feat: respect listen mode in recommended videos (#3430)
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-F-Helm authored Mar 19, 2024
1 parent 00c15cb commit 113e643
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/components/PlaylistVideos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:item="related"
:index="index"
:playlist-id="playlistId"
:prefer-listen="preferListen"
height="94"
width="168"
/>
Expand All @@ -15,6 +16,7 @@
<script>
import { nextTick } from "vue";
import VideoItem from "./VideoItem.vue";
export default {
components: { VideoItem },
props: {
Expand All @@ -30,6 +32,10 @@ export default {
type: Number,
required: true,
},
preferListen: {
type: Boolean,
default: false,
},
},
watch: {
playlist: {
Expand Down
10 changes: 6 additions & 4 deletions src/components/VideoItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
v: item.url.substr(-11),
...(playlistId && { list: playlistId }),
...(index >= 0 && { index: index + 1 }),
...(preferListen && { listen: 1 }),
},
}"
>
Expand Down Expand Up @@ -99,13 +100,13 @@
v: item.url.substr(-11),
...(playlistId && { list: playlistId }),
...(index >= 0 && { index: index + 1 }),
listen: '1',
...(!preferListen && { listen: 1 }),
},
}"
:aria-label="'Listen to ' + title"
:title="'Listen to ' + title"
:aria-label="preferListen ? title : 'Listen to ' + title"
:title="preferListen ? title : 'Listen to ' + title"
>
<i class="i-fa6-solid:headphones" />
<font-awesome-icon :icon="preferListen ? 'i-fa6-solid:tv' : 'i-fa6-solid:headphones'" />
</router-link>
<button :title="$t('actions.add_to_playlist')" @click="showPlaylistModal = !showPlaylistModal">
<i class="i-fa6-solid:circle-plus" />
Expand Down Expand Up @@ -167,6 +168,7 @@ export default {
hideChannel: { type: Boolean, default: false },
index: { type: Number, default: -1 },
playlistId: { type: String, default: null },
preferListen: { type: Boolean, default: false },
admin: { type: Boolean, default: false },
},
emits: ["remove"],
Expand Down
2 changes: 2 additions & 0 deletions src/components/WatchVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
:playlist-id="playlistId"
:playlist="playlist"
:selected-index="index"
:prefer-listen="isListening"
/>
<a
v-t="`actions.${showRecs ? 'minimize_recommendations' : 'show_recommendations'}`"
Expand All @@ -265,6 +266,7 @@
v-for="related in video.relatedStreams"
:key="related.url"
:item="related"
:prefer-listen="isListening"
class="mb-4"
height="94"
width="168"
Expand Down

0 comments on commit 113e643

Please sign in to comment.