mirror of
https://github.com/VueTubeApp/VueTube
synced 2025-01-05 07:01:14 +00:00
fix: minor bug fixes
This commit is contained in:
parent
d738524bc1
commit
7d27314a32
4 changed files with 21 additions and 22 deletions
|
@ -26,7 +26,7 @@ export default {
|
|||
computed: {
|
||||
recommends: {
|
||||
get() {
|
||||
return this.$store.state.recommendedVideos;
|
||||
return [...this.$store.state.recommendedVideos];
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("updateRecommendedVideos", val);
|
||||
|
|
|
@ -157,14 +157,14 @@
|
|||
@click="showComments = !showComments"
|
||||
>
|
||||
<v-card flat class="background comment-renderer">
|
||||
<v-text class="comment-count keep-spaces">
|
||||
<v-card-text class="comment-count keep-spaces">
|
||||
<template v-for="text in video.commentData.headerText.runs">
|
||||
<template v-if="text.bold">
|
||||
<strong :key="text.text">{{ text.text }}</strong>
|
||||
</template>
|
||||
<template v-else>{{ text.text }}</template>
|
||||
</template>
|
||||
</v-text>
|
||||
</v-card-text>
|
||||
<v-icon v-if="showComments">mdi-unfold-less-horizontal</v-icon>
|
||||
<v-icon v-else>mdi-unfold-more-horizontal</v-icon>
|
||||
</v-card>
|
||||
|
@ -261,7 +261,7 @@ export default {
|
|||
this.backHandler = CapacitorApp.addListener(
|
||||
"backButton",
|
||||
({ canGoBack }) => {
|
||||
//--- Back Closes Search ---//
|
||||
//--- First, handle anything that needs to be dismissed first ---//
|
||||
if (this.showComments) {
|
||||
this.showComments = false;
|
||||
|
||||
|
@ -410,6 +410,7 @@ export default {
|
|||
interval: null,
|
||||
video: null,
|
||||
useBetaPlayer: false,
|
||||
backHierarchy: [],
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -298,7 +298,9 @@ class Innertube {
|
|||
isLive: details.isLiveContent,
|
||||
channelName: details.author,
|
||||
channelSubs: ownerData?.collapsedSubtitle?.runs[0]?.text,
|
||||
channelUrl: rendererUtils.getNavigationEndpoints(ownerData),
|
||||
channelUrl: rendererUtils.getNavigationEndpoints(
|
||||
ownerData.navigationEndpoint
|
||||
),
|
||||
channelImg: ownerData?.thumbnail?.thumbnails[0].url,
|
||||
availableResolutions: resolutions?.formats,
|
||||
availableResolutionsAdaptive: resolutions?.adaptiveFormats,
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
// General utility functions for the renderers
|
||||
class rendererUtils {
|
||||
static getNavigationEndpoints(base) {
|
||||
const navEndpoint = base.navigationEndpoint;
|
||||
if (!navEndpoint) return;
|
||||
if (navEndpoint.urlEndpoint) {
|
||||
const params = new Proxy(
|
||||
new URLSearchParams(navEndpoint.urlEndpoint.url),
|
||||
{
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
}
|
||||
);
|
||||
if (!base) return;
|
||||
if (base.urlEndpoint) {
|
||||
const params = new Proxy(new URLSearchParams(base.urlEndpoint.url), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
});
|
||||
if (params.q) return decodeURI(params.q);
|
||||
else return new URL(navEndpoint.urlEndpoint.url).pathname;
|
||||
} else if (navEndpoint.browseEndpoint) {
|
||||
return navEndpoint.browseEndpoint.canonicalBaseUrl;
|
||||
} else if (navEndpoint.watchEndpoint) {
|
||||
return `/watch?v=${navEndpoint.watchEndpoint.videoId}`;
|
||||
} else if (navEndpoint.navigationEndpoint) {
|
||||
else return new URL(base.urlEndpoint.url).pathname;
|
||||
} else if (base.browseEndpoint) {
|
||||
return base.browseEndpoint.canonicalBaseUrl;
|
||||
} else if (base.watchEndpoint) {
|
||||
return `/watch?v=${base.watchEndpoint.videoId}`;
|
||||
} else if (base.navigationEndpoint) {
|
||||
return; //for now
|
||||
} else if (navEndpoint.searchEndpoint) {
|
||||
return `/search?q=${encodeURI(navEndpoint.searchEndpoint.query)}`;
|
||||
} else if (base.searchEndpoint) {
|
||||
return `/search?q=${encodeURI(base.searchEndpoint.query)}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue