[Enhancement] Add Media Center support for videos uploaded on the same day (#221)

* Added upload date index field to media_items

* Added incrementing index for upload dates

* Added media item upload date index to download option builder

* Added new season_episode_index_from_date to UI; updated parser

* Improve support for channels

* Hopefully fixed flakey test
This commit is contained in:
Kieran
2024-05-02 11:06:10 -07:00
committed by GitHub
parent 112c6a4f14
commit 04b14719ee
10 changed files with 261 additions and 16 deletions
+8
View File
@@ -25,6 +25,10 @@ defmodule Pinchflat.Media.MediaQuery do
MediaItem
end
def for_source(query, source_id) when is_integer(source_id) do
where(query, [mi], mi.source_id == ^source_id)
end
def for_source(query, source) do
where(query, [mi], mi.source_id == ^source.id)
end
@@ -99,6 +103,10 @@ defmodule Pinchflat.Media.MediaQuery do
|> where([mi, source], is_nil(source.download_cutoff_date) or mi.upload_date >= source.download_cutoff_date)
end
def where_uploaded_on_date(query, date) do
where(query, [mi], mi.upload_date == ^date)
end
def where_download_not_prevented(query) do
where(query, [mi], mi.prevent_download == false)
end