From e71fdc8dbac5c77d6c2fd252f31fc12cd6375e30 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Tue, 20 Dec 2022 00:35:56 +0100 Subject: fix: Fix related streams on API endpoints --- src/backend/tau/api/comment.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/tau/api/comment.clj') diff --git a/src/backend/tau/api/comment.clj b/src/backend/tau/api/comment.clj index 18881cb..956090e 100644 --- a/src/backend/tau/api/comment.clj +++ b/src/backend/tau/api/comment.clj @@ -15,7 +15,7 @@ [id text upload-name upload-avatar upload-date upload-url upload-verified? like-count hearted-by-upload? pinned? replies]) -(defn get-comment-result +(defn get-result [comment] (map->Comment {:id (.getCommentId comment) @@ -31,17 +31,17 @@ :replies (when (.getReplies comment) (j/from-java (.getReplies comment)))})) -(defn get-comments-info +(defn get-info ([url] (let [info (CommentsInfo/getInfo (url-decode url))] (map->CommentsPage - {:comments (map #(get-comment-result %) (.getRelatedItems info)) + {:comments (map #(get-result %) (.getRelatedItems info)) :next-page (j/from-java (.getNextPage info)) :disabled? (.isCommentsDisabled info)}))) ([url page-url] (let [service (NewPipe/getServiceByUrl (url-decode url)) info (CommentsInfo/getMoreItems service url (Page. (url-decode page-url)))] (map->CommentsPage - {:comments (map #(get-comment-result %) (.getItems info)) + {:comments (map #(get-result %) (.getItems info)) :next-page (j/from-java (.getNextPage info)) :disabled? false})))) -- cgit v1.2.3