From cf0dda3a48dbd507587a685129387d939644aa26 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 11 Mar 2023 19:44:07 +0100 Subject: [PATCH] Support for YouTube handles --- src/components/ChannelPage.vue | 4 +++- src/router/router.js | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue index 75966797..73685671 100644 --- a/src/components/ChannelPage.vue +++ b/src/components/ChannelPage.vue @@ -121,7 +121,9 @@ export default { }); }, async fetchChannel() { - const url = this.apiUrl() + "/" + this.$route.params.path + "/" + this.$route.params.channelId; + const url = this.$route.path.includes("@") + ? this.apiUrl() + "/c/" + this.$route.params.channelId + : this.apiUrl() + "/" + this.$route.params.path + "/" + this.$route.params.channelId; return await this.fetchJson(url); }, async getChannelData() { diff --git a/src/router/router.js b/src/router/router.js index 29bb7c61..440355ed 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -41,6 +41,11 @@ const routes = [ name: "Channel", component: () => import("../components/ChannelPage.vue"), }, + { + path: "/@:channelId", + name: "Channel handle", + component: () => import("../components/ChannelPage.vue"), + }, { path: "/login", name: "Login",