-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9ebdd6
commit 7439795
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
defmodule Radiator.EpisodeOutliner do | ||
alias Radiator.Outline.NodeRepository | ||
# alias Radiator.Outline | ||
alias Radiator.Podcast | ||
alias Radiator.Podcast.Episode | ||
|
||
@doc """ | ||
Returns a list of all child nodes. | ||
""" | ||
def list_nodes_by_episode_sorted(episode_id) do | ||
%Episode{outline_node_container: outline_node_container} = Podcast.get_episode!(episode_id) | ||
|
||
outline_node_container | ||
|> NodeRepository.list_nodes_by_node_container() | ||
end | ||
|
||
def insert_node(%{"episode_id" => episode_id} = attrs) do | ||
%Episode{outline_node_container: outline_node_container} = Podcast.get_episode!(episode_id) | ||
|
||
attrs | ||
|> Map.put("outline_node_container", outline_node_container) | ||
|> insert_node() | ||
end | ||
end |