fix empty new_posts count

This commit is contained in:
2024-08-12 16:37:50 +02:00
parent bf7f1a4601
commit 6751ade1d9

View File

@ -38,7 +38,11 @@ defmodule SomethingErlang.AwfulApi.Bookmarks do
info = Meeseeks.one(td, css(".info")) info = Meeseeks.one(td, css(".info"))
%{ %{
new_posts: Meeseeks.text(last_seen) |> String.to_integer(), new_posts:
case Meeseeks.text(last_seen) do
nil -> 0
n -> String.to_integer(n)
end,
thread_title: Meeseeks.text(Meeseeks.one(info, css(".thread_title"))) thread_title: Meeseeks.text(Meeseeks.one(info, css(".thread_title")))
} }
end end