Namespaced notification modules under lifecycle
This commit is contained in:
parent
8051107d32
commit
799fa4fe32
10 changed files with 12 additions and 12 deletions
|
|
@ -14,7 +14,7 @@ config :pinchflat,
|
|||
yt_dlp_executable: System.find_executable("yt-dlp"),
|
||||
apprise_executable: System.find_executable("apprise"),
|
||||
yt_dlp_runner: Pinchflat.YtDlp.CommandRunner,
|
||||
apprise_runner: Pinchflat.Notifications.CommandRunner,
|
||||
apprise_runner: Pinchflat.Lifecycle.Notifications.CommandRunner,
|
||||
media_directory: "/downloads",
|
||||
# The user may or may not store metadata for their needs, but the app will always store its copy
|
||||
metadata_directory: "/config/metadata",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ defmodule Pinchflat.FastIndexing.FastIndexingWorker do
|
|||
alias Pinchflat.Settings
|
||||
alias Pinchflat.Sources.Source
|
||||
alias Pinchflat.FastIndexing.FastIndexingHelpers
|
||||
alias Pinchflat.Notifications.SourceNotifications
|
||||
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||
|
||||
@doc """
|
||||
Starts the source fast indexing worker and creates a task for the source.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Pinchflat.Notifications.AppriseCommandRunner do
|
||||
defmodule Pinchflat.Lifecycle.Notifications.AppriseCommandRunner do
|
||||
@moduledoc """
|
||||
A behaviour for running CLI commands against a notification backend (apprise).
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Pinchflat.Notifications.CommandRunner do
|
||||
defmodule Pinchflat.Lifecycle.Notifications.CommandRunner do
|
||||
@moduledoc """
|
||||
Runs apprise commands using the `System.cmd/3` function
|
||||
"""
|
||||
|
|
@ -7,7 +7,7 @@ defmodule Pinchflat.Notifications.CommandRunner do
|
|||
|
||||
alias Pinchflat.Utils.CliUtils
|
||||
alias Pinchflat.Utils.FunctionUtils
|
||||
alias Pinchflat.Notifications.AppriseCommandRunner
|
||||
alias Pinchflat.Lifecycle.Notifications.AppriseCommandRunner
|
||||
|
||||
@behaviour AppriseCommandRunner
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Pinchflat.Notifications.SourceNotifications do
|
||||
defmodule Pinchflat.Lifecycle.Notifications.SourceNotifications do
|
||||
@moduledoc """
|
||||
Contains utilities for sending notifications about sources
|
||||
"""
|
||||
|
|
@ -15,7 +15,7 @@ defmodule Pinchflat.SlowIndexing.MediaCollectionIndexingWorker do
|
|||
alias Pinchflat.Sources.Source
|
||||
alias Pinchflat.FastIndexing.FastIndexingWorker
|
||||
alias Pinchflat.SlowIndexing.SlowIndexingHelpers
|
||||
alias Pinchflat.Notifications.SourceNotifications
|
||||
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||
|
||||
@doc """
|
||||
Starts the source slow indexing worker and creates a task for the source.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
defmodule Pinchflat.Notifications.CommandRunnerTest do
|
||||
defmodule Pinchflat.Lifecycle.Notifications.CommandRunnerTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
alias Pinchflat.Notifications.CommandRunner, as: Runner
|
||||
alias Pinchflat.Lifecycle.Notifications.CommandRunner, as: Runner
|
||||
|
||||
@original_executable Application.compile_env(:pinchflat, :apprise_executable)
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
defmodule Pinchflat.Notifications.SourceNotificationsTest do
|
||||
defmodule Pinchflat.Lifecycle.Notifications.SourceNotificationsTest do
|
||||
use Pinchflat.DataCase
|
||||
|
||||
import Mox
|
||||
import Pinchflat.MediaFixtures
|
||||
import Pinchflat.SourcesFixtures
|
||||
|
||||
alias Pinchflat.Notifications.SourceNotifications
|
||||
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||
|
||||
@apprise_servers ["server_1", "server_2"]
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
Mox.defmock(YtDlpRunnerMock, for: Pinchflat.YtDlp.YtDlpCommandRunner)
|
||||
Application.put_env(:pinchflat, :yt_dlp_runner, YtDlpRunnerMock)
|
||||
|
||||
Mox.defmock(AppriseRunnerMock, for: Pinchflat.Notifications.AppriseCommandRunner)
|
||||
Mox.defmock(AppriseRunnerMock, for: Pinchflat.Lifecycle.Notifications.AppriseCommandRunner)
|
||||
Application.put_env(:pinchflat, :apprise_runner, AppriseRunnerMock)
|
||||
|
||||
Mox.defmock(HTTPClientMock, for: Pinchflat.HTTP.HTTPBehaviour)
|
||||
|
|
|
|||
Loading…
Reference in a new issue