diff --git a/src/Pimvidious.nim b/src/Pimvidious.nim index 0156e08..6c7ecda 100644 --- a/src/Pimvidious.nim +++ b/src/Pimvidious.nim @@ -38,7 +38,7 @@ proc staticFileHandler(request: Request) = proc rssHandler(request: Request) = echo request.uri var headers: HttpHeaders - let content = genRSS(path=request.uri) + let content = genRSS(feedpath=request.uri) headers["content-type"] = "application/rss+xml" request.respond(200, headers, content) @@ -53,7 +53,7 @@ proc createRouter(): Router = router.get("/favicon.ico", staticFileHandler) router.get("/favicon.png", staticFileHandler) router.get("/css.css", staticFileHandler) - router.get("/*.rss", rssHandler) + router.get("/feed.xml", rssHandler) return router diff --git a/src/genpage.nim b/src/genpage.nim index d65e1ef..f2edb74 100644 --- a/src/genpage.nim +++ b/src/genpage.nim @@ -156,7 +156,8 @@ proc genpage*(path: string, video_uri: string = ""): string = else: return compilePage(content, video_uri) -proc genRSS*(path: string): string = +proc genRSS*(feedpath: string): string = + let path = feedpath.replace("feed.xml","") let content = request(XV & path) let search_query = findSearchQuery(path) return compileRSSPage(content, search_query = search_query)