Added media profile link to source view

This commit is contained in:
Kieran Eglin 2024-02-04 21:22:12 -08:00
parent e4300391b6
commit 435a25ad84
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 11 additions and 1 deletions

View file

@ -1,6 +1,7 @@
defmodule PinchflatWeb.MediaSources.SourceController do defmodule PinchflatWeb.MediaSources.SourceController do
use PinchflatWeb, :controller use PinchflatWeb, :controller
alias Pinchflat.Repo
alias Pinchflat.Profiles alias Pinchflat.Profiles
alias Pinchflat.MediaSource alias Pinchflat.MediaSource
alias Pinchflat.MediaSource.Source alias Pinchflat.MediaSource.Source
@ -30,7 +31,10 @@ defmodule PinchflatWeb.MediaSources.SourceController do
end end
def show(conn, %{"id" => id}) do def show(conn, %{"id" => id}) do
source = MediaSource.get_source!(id) source =
id
|> MediaSource.get_source!()
|> Repo.preload(:media_profile)
render(conn, :show, source: source) render(conn, :show, source: source)
end end

View file

@ -9,6 +9,12 @@
</.header> </.header>
<.list> <.list>
<:item title="media_profile">
<.link href={~p"/media_profiles/#{@source.media_profile}"}>
<%= @source.media_profile.name %>
</.link>
</:item>
<:item <:item
:for={attr <- ~w(collection_type collection_name collection_id original_url friendly_name)a} :for={attr <- ~w(collection_type collection_name collection_id original_url friendly_name)a}
title={attr} title={attr}