Skip to content

Commit

Permalink
fix: is valid gallery check
Browse files Browse the repository at this point in the history
  • Loading branch information
malcodeman committed Nov 28, 2024
1 parent b577e02 commit bee9ca7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/_lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ export const parsePosts = (posts: RedditPost[]) => {
const isValidGallery = (item: RedditPost) =>
and(
equals(item.data.is_gallery, true),
all(
(item) => equals(item.status, "valid"),
values(item.data.media_metadata ?? {}),
),
item.data.media_metadata
? all(
(item) => equals(item.status, "valid"),
values(item.data.media_metadata),
)
: false,
);
const isImgurAndOver18 = (item: RedditPost) =>
and(isImgur(item.data.url), item.data.over_18);
Expand Down

0 comments on commit bee9ca7

Please sign in to comment.