Skip to content

Commit

Permalink
Clean up External Player Default Viewing Mode link template logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kommunarr committed Oct 24, 2024
1 parent 5a54142 commit bb3be09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
13 changes: 7 additions & 6 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,18 @@ export default defineComponent({
return this.isInQuickBookmarkPlaylist ? 'base favorite' : 'base'
},

watchPageLinkType() {
return this.externalPlayerIsDefaultViewingMode ? 'a' : 'router-link'
},

watchPageLinkTo() {
// For `router-link` attribute `to`
watchVideoRoute() {
return {
path: `/watch/${this.id}`,
query: this.watchPageLinkQuery,
}
},

// For `router-link` attribute `to`
watchVideoRouterLink() {
return !this.externalPlayerIsDefaultViewingMode ? this.watchVideoRoute : {}
},

watchPageLinkQuery() {
const query = {}
if (this.playlistIdFinal) { query.playlistId = this.playlistIdFinal }
Expand Down
20 changes: 8 additions & 12 deletions src/renderer/components/ft-list-video/ft-list-video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@
<div
class="videoThumbnail"
>
<component
:is="watchPageLinkType"
<router-link
class="thumbnailLink"
tabindex="-1"
:to="watchPageLinkTo"
href="javascript:void(0)"
@click="handleWatchPageLinkClick"
:to="watchVideoRouterLink"
@click.native="handleWatchPageLinkClick"
>
<img
:src="thumbnail"
class="thumbnailImage"
alt=""
:style="{filter: blurThumbnailsStyle}"
>
</component>
</router-link>
<div
v-if="isLive || isUpcoming || (displayDuration !== '' && displayDuration !== '0:00')"
class="videoDuration"
Expand Down Expand Up @@ -113,17 +111,15 @@
/>
</div>
<div class="info">
<component
:is="watchPageLinkType"
<router-link
class="title"
:to="watchPageLinkTo"
href="javascript:void(0)"
@click="handleWatchPageLinkClick"
:to="watchVideoRouterLink"
@click.native="handleWatchPageLinkClick"
>
<h3 class="h3Title">
{{ displayTitle }}
</h3>
</component>
</router-link>
<div class="infoLine">
<router-link
v-if="channelId !== null"
Expand Down

0 comments on commit bb3be09

Please sign in to comment.