File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,7 @@ fridayCommand =
134134 [qms |Could not check friday video
135135 duplicates because there is no YouTube
136136 id in the message.|]) $
137- liftR
138- (\ ytId ->
139- selectEntities (Proxy :: Proxy FridayVideo ) $
140- Filter (PropertyTextLike " name" (" %" <> ytId <> " %" )) All ) $
137+ liftR fridayVideosByYtId $
141138 cmapR
142139 (\ dups ->
143140 [qms |Added to the suggested video.
@@ -323,13 +320,15 @@ videoQueueCommand =
323320 cmapR (const " Freshness invalidated 👌" ) $ Reaction replyMessage)
324321 ]
325322
323+ fridayVideosByYtId :: T. Text -> Effect [Entity FridayVideo ]
324+ fridayVideosByYtId ytId =
325+ selectEntities Proxy $
326+ Filter (PropertyTextLike " name" (" %" <> ytId <> " %" )) All
327+
326328fridayCountCommand :: Reaction Message T. Text
327329fridayCountCommand =
328330 cmapR ytLinkId $
329331 replyOnNothing " Please submit a YouTube link" $
330- liftR
331- (\ ytId ->
332- selectEntities (Proxy :: Proxy FridayVideo ) $
333- Filter (PropertyTextLike " name" (" %" <> ytId <> " %" )) All ) $
332+ liftR fridayVideosByYtId $
334333 cmapR (\ dups -> [qms |This video was suggested {length dups} times|]) $
335334 Reaction replyMessage
You can’t perform that action at this time.
0 commit comments