aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tau/api/comment.clj
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-20 00:35:56 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-20 00:54:58 +0100
commite71fdc8dbac5c77d6c2fd252f31fc12cd6375e30 (patch)
tree890953876b06a647e6790715f2580aa94aebe4a7 /src/backend/tau/api/comment.clj
parente4714f94ff6d01847fa61c33c678b6d856c3b30a (diff)
fix: Fix related streams on API endpoints
Diffstat (limited to 'src/backend/tau/api/comment.clj')
-rw-r--r--src/backend/tau/api/comment.clj8
1 files changed, 4 insertions, 4 deletions
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}))))