Added regex field and UI to source form

This commit is contained in:
Kieran Eglin 2024-03-20 08:43:54 -07:00
parent 67f234f8e3
commit af8f8c7b2f
No known key found for this signature in database
GPG key ID: 193984967FCF432D
3 changed files with 25 additions and 5 deletions

View file

@ -28,6 +28,7 @@ defmodule Pinchflat.Sources.Source do
last_indexed_at
original_url
download_cutoff_date
title_filter_regex
media_profile_id
)a
@ -57,11 +58,6 @@ defmodule Pinchflat.Sources.Source do
field :collection_name, :string
field :collection_id, :string
field :collection_type, Ecto.Enum, values: [:channel, :playlist]
field :nfo_filepath, :string
field :poster_filepath, :string
field :fanart_filepath, :string
field :banner_filepath, :string
field :series_directory, :string
field :index_frequency_minutes, :integer, default: 60 * 24
field :fast_index, :boolean, default: false
field :download_media, :boolean, default: true
@ -69,6 +65,13 @@ defmodule Pinchflat.Sources.Source do
# Only download media items that were published after this date
field :download_cutoff_date, :date
field :original_url, :string
field :title_filter_regex, :string
field :series_directory, :string
field :nfo_filepath, :string
field :poster_filepath, :string
field :fanart_filepath, :string
field :banner_filepath, :string
belongs_to :media_profile, MediaProfile

View file

@ -89,6 +89,14 @@
</p>
</section>
<.input
field={f[:title_filter_regex]}
type="text"
label="Title Filter Regex"
placeholder="/^How to Bike/i"
help="A PCRE-compatible regex. Only media with titles that match this regex will be downloaded"
/>
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto">Save Source</.button>
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">

View file

@ -0,0 +1,9 @@
defmodule Pinchflat.Repo.Migrations.AddTitleRegexToSource do
use Ecto.Migration
def change do
alter table(:sources) do
add :title_filter_regex, :string
end
end
end