[Enhancement] Add history table to homepage (And TZ support) (#229)

* Added basic history table to homepage

* Improved homepage history query

* Set table to use 24h time

* Added timezone support

* Updated README to reflect new TZ stuff
This commit is contained in:
Kieran
2024-05-07 12:16:57 -07:00
committed by GitHub
parent 1b7fb6d14b
commit a1a568b7f7
10 changed files with 165 additions and 7 deletions
+8
View File
@@ -21,6 +21,8 @@ defmodule Pinchflat.Media.MediaQuery do
# Suffixes:
# - _for - the arg passed is an association record
# NOTE: that dyanmic query approach kinda rocked - should refactor in future
def new do
MediaItem
end
@@ -172,6 +174,12 @@ defmodule Pinchflat.Media.MediaQuery do
|> matching_source_title_regex()
end
def where_pending_or_downloaded(query) do
query
|> where_pending_download()
|> or_where([mi], not is_nil(mi.media_downloaded_at))
end
defp require_assoc(query, identifier) do
if has_named_binding?(query, identifier) do
query