Add time machine

This commit is contained in:
2023-12-16 11:56:37 +11:00
parent 65be48b519
commit db3f9be40f
10 changed files with 163 additions and 8 deletions

View File

@@ -15,6 +15,12 @@ module Adamantium
.limit(5)
.to_a
end
def for_timemachine(date:)
podcast_scrobbles
.where(listened_at: TimeMath.day.floor(date)...TimeMath.day.advance(date, +1))
.to_a
end
end
end
end

View File

@@ -140,6 +140,20 @@ module Adamantium
.to_a
end
def posts_for_timemachine(date:)
posts
.where(post_type: "post")
.where(published_at: TimeMath.day.floor(date)...TimeMath.day.advance(date, +1))
.to_a
end
def bookmarks_for_timemachine(date:)
posts
.where(post_type: "bookmark")
.where(published_at: TimeMath.day.floor(date)...TimeMath.day.advance(date, +1))
.to_a
end
def for_rss
posts
.where(post_type: "post", location: nil)