diff options
Diffstat (limited to 'server/controllers/client.ts')
-rw-r--r-- | server/controllers/client.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index f9514d988..a85c10720 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -138,7 +138,14 @@ async function generateEmbedHtmlPage (req: express.Request, res: express.Respons | |||
138 | } | 138 | } |
139 | 139 | ||
140 | async function generateWatchHtmlPage (req: express.Request, res: express.Response) { | 140 | async function generateWatchHtmlPage (req: express.Request, res: express.Response) { |
141 | const html = await ClientHtml.getWatchHTMLPage(req.params.id + '', req, res) | 141 | // Thread link is '/w/:videoId;threadId=:threadId' |
142 | // So to get the videoId we need to remove the last part | ||
143 | let videoId = req.params.id + '' | ||
144 | |||
145 | const threadIdIndex = videoId.indexOf(';threadId') | ||
146 | if (threadIdIndex !== -1) videoId = videoId.substring(0, threadIdIndex) | ||
147 | |||
148 | const html = await ClientHtml.getWatchHTMLPage(videoId, req, res) | ||
142 | 149 | ||
143 | return sendHTML(html, res, true) | 150 | return sendHTML(html, res, true) |
144 | } | 151 | } |