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"),
|
yt_dlp_executable: System.find_executable("yt-dlp"),
|
||||||
apprise_executable: System.find_executable("apprise"),
|
apprise_executable: System.find_executable("apprise"),
|
||||||
yt_dlp_runner: Pinchflat.YtDlp.CommandRunner,
|
yt_dlp_runner: Pinchflat.YtDlp.CommandRunner,
|
||||||
apprise_runner: Pinchflat.Notifications.CommandRunner,
|
apprise_runner: Pinchflat.Lifecycle.Notifications.CommandRunner,
|
||||||
media_directory: "/downloads",
|
media_directory: "/downloads",
|
||||||
# The user may or may not store metadata for their needs, but the app will always store its copy
|
# The user may or may not store metadata for their needs, but the app will always store its copy
|
||||||
metadata_directory: "/config/metadata",
|
metadata_directory: "/config/metadata",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ defmodule Pinchflat.FastIndexing.FastIndexingWorker do
|
||||||
alias Pinchflat.Settings
|
alias Pinchflat.Settings
|
||||||
alias Pinchflat.Sources.Source
|
alias Pinchflat.Sources.Source
|
||||||
alias Pinchflat.FastIndexing.FastIndexingHelpers
|
alias Pinchflat.FastIndexing.FastIndexingHelpers
|
||||||
alias Pinchflat.Notifications.SourceNotifications
|
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Starts the source fast indexing worker and creates a task for the source.
|
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 """
|
@moduledoc """
|
||||||
A behaviour for running CLI commands against a notification backend (apprise).
|
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 """
|
@moduledoc """
|
||||||
Runs apprise commands using the `System.cmd/3` function
|
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.CliUtils
|
||||||
alias Pinchflat.Utils.FunctionUtils
|
alias Pinchflat.Utils.FunctionUtils
|
||||||
alias Pinchflat.Notifications.AppriseCommandRunner
|
alias Pinchflat.Lifecycle.Notifications.AppriseCommandRunner
|
||||||
|
|
||||||
@behaviour AppriseCommandRunner
|
@behaviour AppriseCommandRunner
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
defmodule Pinchflat.Notifications.SourceNotifications do
|
defmodule Pinchflat.Lifecycle.Notifications.SourceNotifications do
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
Contains utilities for sending notifications about sources
|
Contains utilities for sending notifications about sources
|
||||||
"""
|
"""
|
||||||
|
|
@ -15,7 +15,7 @@ defmodule Pinchflat.SlowIndexing.MediaCollectionIndexingWorker do
|
||||||
alias Pinchflat.Sources.Source
|
alias Pinchflat.Sources.Source
|
||||||
alias Pinchflat.FastIndexing.FastIndexingWorker
|
alias Pinchflat.FastIndexing.FastIndexingWorker
|
||||||
alias Pinchflat.SlowIndexing.SlowIndexingHelpers
|
alias Pinchflat.SlowIndexing.SlowIndexingHelpers
|
||||||
alias Pinchflat.Notifications.SourceNotifications
|
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Starts the source slow indexing worker and creates a task for the source.
|
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
|
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)
|
@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
|
use Pinchflat.DataCase
|
||||||
|
|
||||||
import Mox
|
import Mox
|
||||||
import Pinchflat.MediaFixtures
|
import Pinchflat.MediaFixtures
|
||||||
import Pinchflat.SourcesFixtures
|
import Pinchflat.SourcesFixtures
|
||||||
|
|
||||||
alias Pinchflat.Notifications.SourceNotifications
|
alias Pinchflat.Lifecycle.Notifications.SourceNotifications
|
||||||
|
|
||||||
@apprise_servers ["server_1", "server_2"]
|
@apprise_servers ["server_1", "server_2"]
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
Mox.defmock(YtDlpRunnerMock, for: Pinchflat.YtDlp.YtDlpCommandRunner)
|
Mox.defmock(YtDlpRunnerMock, for: Pinchflat.YtDlp.YtDlpCommandRunner)
|
||||||
Application.put_env(:pinchflat, :yt_dlp_runner, YtDlpRunnerMock)
|
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)
|
Application.put_env(:pinchflat, :apprise_runner, AppriseRunnerMock)
|
||||||
|
|
||||||
Mox.defmock(HTTPClientMock, for: Pinchflat.HTTP.HTTPBehaviour)
|
Mox.defmock(HTTPClientMock, for: Pinchflat.HTTP.HTTPBehaviour)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue