Search v1 (#19)
* Adds description to media items; hooks it up to indexing/media downloading * Added a search method using postgres fulltext search * Hooked up search functionality to the search form * Added persistence to the search form when on search page
This commit is contained in:
@@ -13,6 +13,7 @@ defmodule Pinchflat.Media.MediaItem do
|
||||
@allowed_fields ~w(
|
||||
title
|
||||
media_id
|
||||
description
|
||||
original_url
|
||||
livestream
|
||||
media_downloaded_at
|
||||
@@ -27,6 +28,7 @@ defmodule Pinchflat.Media.MediaItem do
|
||||
schema "media_items" do
|
||||
field :title, :string
|
||||
field :media_id, :string
|
||||
field :description, :string
|
||||
field :original_url, :string
|
||||
field :livestream, :boolean, default: false
|
||||
field :media_downloaded_at, :utc_datetime
|
||||
@@ -39,6 +41,8 @@ defmodule Pinchflat.Media.MediaItem do
|
||||
# Will very likely revisit because I can't leave well-enough alone.
|
||||
field :subtitle_filepaths, {:array, {:array, :string}}, default: []
|
||||
|
||||
field :matching_search_term, :string, virtual: true
|
||||
|
||||
belongs_to :source, Source
|
||||
|
||||
has_one :metadata, MediaMetadata, on_replace: :update
|
||||
|
||||
Reference in New Issue
Block a user