From af60ae57818c7b420401c21f3fb9fc90223119a4 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Wed, 18 Dec 2024 17:47:41 +0000 Subject: [PATCH] added starts of rss feeds... ha --- src/Pimvidious.nim | 4 ++-- src/genpage.nim | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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)