Renamed Downloader namespace to MediaClient

This commit is contained in:
Kieran Eglin 2024-01-23 10:28:07 -08:00
parent 65ac4c119a
commit 94414989af
No known key found for this signature in database
GPG key ID: 193984967FCF432D
16 changed files with 28 additions and 28 deletions

View file

@ -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

View file

@ -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
"""

View file

@ -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.

View file

@ -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

View file

@ -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
"""

View file

@ -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).

View file

@ -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

View file

@ -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 """

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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{

View file

@ -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()