diff --git a/config/config.exs b/config/config.exs index 92bd240..a859fb3 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,7 +12,7 @@ config :pinchflat, generators: [timestamp_type: :utc_datetime], # Specifying backend data here makes mocking and local testing SUPER easy yt_dlp_executable: System.find_executable("yt-dlp"), - yt_dlp_runner: Pinchflat.Downloader.Backends.YtDlp.CommandRunner, + yt_dlp_runner: Pinchflat.MediaClient.Backends.YtDlp.CommandRunner, # TODO: figure this out media_directory: :not_implemented diff --git a/lib/pinchflat/downloader/backends/backend_command_runner.ex b/lib/pinchflat/media_client/backends/backend_command_runner.ex similarity index 73% rename from lib/pinchflat/downloader/backends/backend_command_runner.ex rename to lib/pinchflat/media_client/backends/backend_command_runner.ex index 866008e..0a26a79 100644 --- a/lib/pinchflat/downloader/backends/backend_command_runner.ex +++ b/lib/pinchflat/media_client/backends/backend_command_runner.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.Backends.BackendCommandRunner do +defmodule Pinchflat.MediaClient.Backends.BackendCommandRunner do @moduledoc """ A behaviour for running CLI commands against a downloader backend """ diff --git a/lib/pinchflat/downloader/backends/yt_dlp/channel.ex b/lib/pinchflat/media_client/backends/yt_dlp/channel.ex similarity index 83% rename from lib/pinchflat/downloader/backends/yt_dlp/channel.ex rename to lib/pinchflat/media_client/backends/yt_dlp/channel.ex index 6b17447..39d7348 100644 --- a/lib/pinchflat/downloader/backends/yt_dlp/channel.ex +++ b/lib/pinchflat/media_client/backends/yt_dlp/channel.ex @@ -1,10 +1,10 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.Channel do +defmodule Pinchflat.MediaClient.Backends.YtDlp.Channel do @moduledoc """ Contains utilities for working with a channel's videos """ - use Pinchflat.Downloader.Backends.YtDlp.VideoCollection - alias Pinchflat.Downloader.ChannelDetails + use Pinchflat.MediaClient.Backends.YtDlp.VideoCollection + alias Pinchflat.MediaClient.ChannelDetails @doc """ Gets a channel's ID and name from its URL. diff --git a/lib/pinchflat/downloader/backends/yt_dlp/command_runner.ex b/lib/pinchflat/media_client/backends/yt_dlp/command_runner.ex similarity index 93% rename from lib/pinchflat/downloader/backends/yt_dlp/command_runner.ex rename to lib/pinchflat/media_client/backends/yt_dlp/command_runner.ex index 1fc2339..f803b02 100644 --- a/lib/pinchflat/downloader/backends/yt_dlp/command_runner.ex +++ b/lib/pinchflat/media_client/backends/yt_dlp/command_runner.ex @@ -1,10 +1,10 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.CommandRunner do +defmodule Pinchflat.MediaClient.Backends.YtDlp.CommandRunner do @moduledoc """ Runs yt-dlp commands using the `System.cmd/3` function """ alias Pinchflat.Utils.StringUtils - alias Pinchflat.Downloader.Backends.BackendCommandRunner + alias Pinchflat.MediaClient.Backends.BackendCommandRunner @behaviour BackendCommandRunner diff --git a/lib/pinchflat/downloader/backends/yt_dlp/video.ex b/lib/pinchflat/media_client/backends/yt_dlp/video.ex similarity index 92% rename from lib/pinchflat/downloader/backends/yt_dlp/video.ex rename to lib/pinchflat/media_client/backends/yt_dlp/video.ex index 73454a6..bea5b3b 100644 --- a/lib/pinchflat/downloader/backends/yt_dlp/video.ex +++ b/lib/pinchflat/media_client/backends/yt_dlp/video.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.Video do +defmodule Pinchflat.MediaClient.Backends.YtDlp.Video do @moduledoc """ Contains utilities for working with singular videos """ diff --git a/lib/pinchflat/downloader/backends/yt_dlp/video_collection.ex b/lib/pinchflat/media_client/backends/yt_dlp/video_collection.ex similarity index 93% rename from lib/pinchflat/downloader/backends/yt_dlp/video_collection.ex rename to lib/pinchflat/media_client/backends/yt_dlp/video_collection.ex index d96feb2..5bff0b8 100644 --- a/lib/pinchflat/downloader/backends/yt_dlp/video_collection.ex +++ b/lib/pinchflat/media_client/backends/yt_dlp/video_collection.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.VideoCollection do +defmodule Pinchflat.MediaClient.Backends.YtDlp.VideoCollection do @moduledoc """ Contains utilities for working with collections of videos (ie: channels, playlists). diff --git a/lib/pinchflat/downloader/channel_details.ex b/lib/pinchflat/media_client/channel_details.ex similarity index 85% rename from lib/pinchflat/downloader/channel_details.ex rename to lib/pinchflat/media_client/channel_details.ex index 529764e..3e952bf 100644 --- a/lib/pinchflat/downloader/channel_details.ex +++ b/lib/pinchflat/media_client/channel_details.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.ChannelDetails do +defmodule Pinchflat.MediaClient.ChannelDetails do @moduledoc """ This is the integration layer for actually working with channels. @@ -8,7 +8,7 @@ defmodule Pinchflat.Downloader.ChannelDetails do @enforce_keys [:id, :name] defstruct [:id, :name] - alias Pinchflat.Downloader.Backends.YtDlp.Channel, as: YtDlpChannel + alias Pinchflat.MediaClient.Backends.YtDlp.Channel, as: YtDlpChannel @doc false def new(id, name) do diff --git a/lib/pinchflat/downloader/video_downloader.ex b/lib/pinchflat/media_client/video_downloader.ex similarity index 90% rename from lib/pinchflat/downloader/video_downloader.ex rename to lib/pinchflat/media_client/video_downloader.ex index d85e635..8d526d7 100644 --- a/lib/pinchflat/downloader/video_downloader.ex +++ b/lib/pinchflat/media_client/video_downloader.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.VideoDownloader do +defmodule Pinchflat.MediaClient.VideoDownloader do @moduledoc """ This is the integration layer for actually downloading videos. It takes into account the media profile's settings in order @@ -10,7 +10,7 @@ defmodule Pinchflat.Downloader.VideoDownloader do alias Pinchflat.Profiles.MediaProfile - alias Pinchflat.Downloader.Backends.YtDlp.Video, as: YtDlpVideo + alias Pinchflat.MediaClient.Backends.YtDlp.Video, as: YtDlpVideo alias Pinchflat.Profiles.Options.YtDlp.OptionBuilder, as: YtDlpOptionBuilder @doc """ diff --git a/test/pinchflat/downloader/backends/yt_dlp/channel_test.exs b/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs similarity index 89% rename from test/pinchflat/downloader/backends/yt_dlp/channel_test.exs rename to test/pinchflat/media_client/backends/yt_dlp/channel_test.exs index 86b6c27..3e12a6c 100644 --- a/test/pinchflat/downloader/backends/yt_dlp/channel_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/channel_test.exs @@ -1,9 +1,9 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.ChannelTest do +defmodule Pinchflat.MediaClient.Backends.YtDlp.ChannelTest do use ExUnit.Case, async: true import Mox - alias Pinchflat.Downloader.ChannelDetails - alias Pinchflat.Downloader.Backends.YtDlp.Channel + alias Pinchflat.MediaClient.ChannelDetails + alias Pinchflat.MediaClient.Backends.YtDlp.Channel @channel_url "https://www.youtube.com/c/TheUselessTrials" diff --git a/test/pinchflat/downloader/backends/yt_dlp/command_runner_test.exs b/test/pinchflat/media_client/backends/yt_dlp/command_runner_test.exs similarity index 93% rename from test/pinchflat/downloader/backends/yt_dlp/command_runner_test.exs rename to test/pinchflat/media_client/backends/yt_dlp/command_runner_test.exs index 3d084e1..6ba8801 100644 --- a/test/pinchflat/downloader/backends/yt_dlp/command_runner_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/command_runner_test.exs @@ -1,7 +1,7 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.CommandRunnerTest do +defmodule Pinchflat.MediaClient.Backends.YtDlp.CommandRunnerTest do use ExUnit.Case, async: true - alias Pinchflat.Downloader.Backends.YtDlp.CommandRunner, as: Runner + alias Pinchflat.MediaClient.Backends.YtDlp.CommandRunner, as: Runner @original_executable Application.compile_env(:pinchflat, :yt_dlp_executable) @video_url "https://www.youtube.com/watch?v=-LHXuyzpex0" diff --git a/test/pinchflat/downloader/backends/yt_dlp/output_path_builder_test.exs b/test/pinchflat/media_client/backends/yt_dlp/output_path_builder_test.exs similarity index 91% rename from test/pinchflat/downloader/backends/yt_dlp/output_path_builder_test.exs rename to test/pinchflat/media_client/backends/yt_dlp/output_path_builder_test.exs index 4098726..4c67a44 100644 --- a/test/pinchflat/downloader/backends/yt_dlp/output_path_builder_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/output_path_builder_test.exs @@ -1,4 +1,4 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.OutputPathBuilderTest do +defmodule Pinchflat.MediaClient.Backends.YtDlp.OutputPathBuilderTest do use ExUnit.Case, async: true alias Pinchflat.Profiles.Options.YtDlp.OutputPathBuilder diff --git a/test/pinchflat/downloader/backends/yt_dlp/video_collection_test.exs b/test/pinchflat/media_client/backends/yt_dlp/video_collection_test.exs similarity index 91% rename from test/pinchflat/downloader/backends/yt_dlp/video_collection_test.exs rename to test/pinchflat/media_client/backends/yt_dlp/video_collection_test.exs index a67131e..787bcd2 100644 --- a/test/pinchflat/downloader/backends/yt_dlp/video_collection_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/video_collection_test.exs @@ -1,8 +1,8 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.VideoCollectionTest do +defmodule Pinchflat.MediaClient.Backends.YtDlp.VideoCollectionTest do use ExUnit.Case, async: true import Mox - alias Pinchflat.Downloader.Backends.YtDlp.VideoCollection + alias Pinchflat.MediaClient.Backends.YtDlp.VideoCollection @channel_url "https://www.youtube.com/@TheUselessTrials" diff --git a/test/pinchflat/downloader/backends/yt_dlp/video_test.exs b/test/pinchflat/media_client/backends/yt_dlp/video_test.exs similarity index 92% rename from test/pinchflat/downloader/backends/yt_dlp/video_test.exs rename to test/pinchflat/media_client/backends/yt_dlp/video_test.exs index 667e3f8..bee9a28 100644 --- a/test/pinchflat/downloader/backends/yt_dlp/video_test.exs +++ b/test/pinchflat/media_client/backends/yt_dlp/video_test.exs @@ -1,8 +1,8 @@ -defmodule Pinchflat.Downloader.Backends.YtDlp.VideoTest do +defmodule Pinchflat.MediaClient.Backends.YtDlp.VideoTest do use ExUnit.Case, async: true import Mox - alias Pinchflat.Downloader.Backends.YtDlp.Video + alias Pinchflat.MediaClient.Backends.YtDlp.Video @video_url "https://www.youtube.com/watch?v=TiZPUDkDYbk" diff --git a/test/pinchflat/downloader/channel_details_test.exs b/test/pinchflat/media_client/channel_details_test.exs similarity index 92% rename from test/pinchflat/downloader/channel_details_test.exs rename to test/pinchflat/media_client/channel_details_test.exs index cc4febd..012161e 100644 --- a/test/pinchflat/downloader/channel_details_test.exs +++ b/test/pinchflat/media_client/channel_details_test.exs @@ -1,8 +1,8 @@ -defmodule Pinchflat.Downloader.ChannelDetailsTest do +defmodule Pinchflat.MediaClient.ChannelDetailsTest do use ExUnit.Case, async: true import Mox - alias Pinchflat.Downloader.ChannelDetails + alias Pinchflat.MediaClient.ChannelDetails @channel_url "https://www.youtube.com/c/TheUselessTrials" diff --git a/test/pinchflat/downloader/video_downloader_test.exs b/test/pinchflat/media_client/video_downloader_test.exs similarity index 91% rename from test/pinchflat/downloader/video_downloader_test.exs rename to test/pinchflat/media_client/video_downloader_test.exs index ba9c485..99ead4e 100644 --- a/test/pinchflat/downloader/video_downloader_test.exs +++ b/test/pinchflat/media_client/video_downloader_test.exs @@ -1,9 +1,9 @@ -defmodule Pinchflat.Downloader.VideoDownloaderTest do +defmodule Pinchflat.MediaClient.VideoDownloaderTest do use ExUnit.Case, async: true import Mox alias Pinchflat.Profiles.MediaProfile - alias Pinchflat.Downloader.VideoDownloader + alias Pinchflat.MediaClient.VideoDownloader @video_url "https://www.youtube.com/watch?v=TiZPUDkDYbk" @media_profile %MediaProfile{ diff --git a/test/test_helper.exs b/test/test_helper.exs index f3caa77..54cb003 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,4 +1,4 @@ -Mox.defmock(YtDlpRunnerMock, for: Pinchflat.Downloader.Backends.BackendCommandRunner) +Mox.defmock(YtDlpRunnerMock, for: Pinchflat.MediaClient.Backends.BackendCommandRunner) Application.put_env(:pinchflat, :yt_dlp_runner, YtDlpRunnerMock) ExUnit.start()