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