mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-03-02 02:31:35 +00:00
Partially fix #29: add routes for /c/ and /user/ paths for channels
This commit is contained in:
parent
5e6b2bf31c
commit
6de9abd499
2 changed files with 6 additions and 6 deletions
|
|
@ -1,16 +1,16 @@
|
|||
const {render} = require("pinski/plugins")
|
||||
const constants = require("../utils/constants")
|
||||
const {fetchChannel} = require("../utils/youtube")
|
||||
const {getUser} = require("../utils/getuser")
|
||||
const converters = require("../utils/converters")
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
route: `/channel/(${constants.regex.ucid})`, methods: ["GET"], code: async ({req, fill, url}) => {
|
||||
const id = fill[0]
|
||||
route: `/(c|channel|user)/(.+)`, methods: ["GET"], code: async ({req, fill, url}) => {
|
||||
const path = fill[0]
|
||||
const id = fill[1]
|
||||
const user = getUser(req)
|
||||
const settings = user.getSettingsOrDefaults()
|
||||
const data = await fetchChannel(id, settings.instance)
|
||||
const data = await fetchChannel(id, path, settings.instance)
|
||||
const subscribed = user.isSubscribed(id)
|
||||
const instanceOrigin = settings.instance
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue