0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 03:05:15 +00:00

refactor(channelRequest): Added new type of channel url - /@examplechannel.

This commit is contained in:
Georgiy 2023-05-26 18:45:54 +03:00
parent e2db406b90
commit 90931d7286

View file

@ -6,7 +6,7 @@ const getDefaultState = () => {
banner: null,
title: null,
subscribe: null,
subscribeAlt: null,
subscribeAlt: "",
descriptionPreview: null,
subscribers: null,
videosCount: null,
@ -22,12 +22,18 @@ export const actions = {
Object.assign(state, getDefaultState());
state.loading = true;
console.log(channelUrl);
const channelRequest =
let channelRequest = "";
console.warn(channelUrl);
if (
channelUrl.includes("/c/") ||
channelUrl.includes("/user/") ||
channelUrl.includes("/channel/")
? `https://youtube.com/${channelUrl}`
: `https://youtube.com/channel/${channelUrl}`;
channelUrl.includes("/channel/") ||
channelUrl.includes("/@")
) {
channelRequest = `https://youtube.com/${channelUrl}`;
} else {
channelRequest = `https://youtube.com/channel/${channelUrl}`;
}
this.$youtube
.getChannel(channelRequest)
.then((channel) => {