pinchflat/test/support/fixtures/profiles_fixtures.ex
Kieran 480af45527
Add "channel" type Media Source (#8)
* [WIP] Working on fetching channel metadata in yt-dlp backend

* Finished first draft of methods to do with querying channels

* Renamed CommandRunnerMock to have a more descriptive name

* Ran the phx generator for the channel model

* Renamed Downloader namespace to MediaClient

* [WIP] saving before attempting LiveView

* LiveView did not work out but here's a working controller how about
2024-01-24 14:07:39 -08:00

21 lines
518 B
Elixir

defmodule Pinchflat.ProfilesFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Pinchflat.Profiles` context.
"""
@doc """
Generate a media_profile.
"""
def media_profile_fixture(attrs \\ %{}) do
{:ok, media_profile} =
attrs
|> Enum.into(%{
name: "Media Profile ##{:rand.uniform(1_000_000)}",
output_path_template: "/video/{{title}}.{{ext}}"
})
|> Pinchflat.Profiles.create_media_profile()
media_profile
end
end