Added column

This commit is contained in:
Kieran Eglin 2024-04-02 12:25:55 -07:00
parent f9c2f7b8f2
commit 00274252f1
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 14 additions and 1 deletions

View file

@ -30,7 +30,9 @@ defmodule Pinchflat.Media.MediaItem do
:subtitle_filepaths, :subtitle_filepaths,
:thumbnail_filepath, :thumbnail_filepath,
:metadata_filepath, :metadata_filepath,
:nfo_filepath :nfo_filepath,
# These are user or system controlled fields
:prevent_download
] ]
# Pretty much all the fields captured at index are required. # Pretty much all the fields captured at index are required.
@required_fields ~w( @required_fields ~w(
@ -70,6 +72,8 @@ defmodule Pinchflat.Media.MediaItem do
# Will very likely revisit because I can't leave well-enough alone. # Will very likely revisit because I can't leave well-enough alone.
field :subtitle_filepaths, {:array, {:array, :string}}, default: [] field :subtitle_filepaths, {:array, {:array, :string}}, default: []
field :prevent_download, :boolean, default: false
field :matching_search_term, :string, virtual: true field :matching_search_term, :string, virtual: true
belongs_to :source, Source belongs_to :source, Source

View file

@ -0,0 +1,9 @@
defmodule Pinchflat.Repo.Migrations.AddPreventDownloadToMediaItems do
use Ecto.Migration
def change do
alter table(:media_items) do
add :prevent_download, :boolean, default: false, null: false
end
end
end