Added upload date (#260)
This commit is contained in:
parent
99fc2eb8f8
commit
3a5c06fe64
1 changed files with 6 additions and 3 deletions
|
|
@ -49,6 +49,9 @@ defmodule Pinchflat.Sources.MediaItemTableLive do
|
||||||
<%= StringUtils.truncate(media_item.title, 50) %>
|
<%= StringUtils.truncate(media_item.title, 50) %>
|
||||||
</.subtle_link>
|
</.subtle_link>
|
||||||
</:col>
|
</:col>
|
||||||
|
<:col :let={media_item} label="Upload Date">
|
||||||
|
<%= media_item.upload_date %>
|
||||||
|
</:col>
|
||||||
<:col :let={media_item} :if={@media_state == "other"} label="Manually Ignored?">
|
<:col :let={media_item} :if={@media_state == "other"} label="Manually Ignored?">
|
||||||
<.icon name={if media_item.prevent_download, do: "hero-check", else: "hero-x-mark"} />
|
<.icon name={if media_item.prevent_download, do: "hero-check", else: "hero-x-mark"} />
|
||||||
</:col>
|
</:col>
|
||||||
|
|
@ -147,14 +150,14 @@ defmodule Pinchflat.Sources.MediaItemTableLive do
|
||||||
|> MediaQuery.require_assoc(:media_profile)
|
|> MediaQuery.require_assoc(:media_profile)
|
||||||
|> MediaQuery.require_assoc(:media_items_search_index)
|
|> MediaQuery.require_assoc(:media_items_search_index)
|
||||||
|> where(^dynamic(^MediaQuery.for_source(source) and ^MediaQuery.pending()))
|
|> where(^dynamic(^MediaQuery.for_source(source) and ^MediaQuery.pending()))
|
||||||
|> order_by(desc: fragment("rank"), desc: :id)
|
|> order_by(desc: fragment("rank"), desc: :upload_date)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp generate_base_query(source, "downloaded") do
|
defp generate_base_query(source, "downloaded") do
|
||||||
MediaQuery.new()
|
MediaQuery.new()
|
||||||
|> MediaQuery.require_assoc(:media_items_search_index)
|
|> MediaQuery.require_assoc(:media_items_search_index)
|
||||||
|> where(^dynamic(^MediaQuery.for_source(source) and ^MediaQuery.downloaded()))
|
|> where(^dynamic(^MediaQuery.for_source(source) and ^MediaQuery.downloaded()))
|
||||||
|> order_by(desc: fragment("rank"), desc: :id)
|
|> order_by(desc: fragment("rank"), desc: :upload_date)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp generate_base_query(source, "other") do
|
defp generate_base_query(source, "other") do
|
||||||
|
|
@ -167,7 +170,7 @@ defmodule Pinchflat.Sources.MediaItemTableLive do
|
||||||
(not (^MediaQuery.downloaded()) and not (^MediaQuery.pending()))
|
(not (^MediaQuery.downloaded()) and not (^MediaQuery.pending()))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|> order_by(desc: fragment("rank"), desc: :id)
|
|> order_by(desc: fragment("rank"), desc: :upload_date)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp filter_base_query(base_query, search_term) do
|
defp filter_base_query(base_query, search_term) do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue