Refactor media import handlers to utilize ManualInboxTaker for improved functionality
ci / build-backend (push) Successful in 1m36s
ci / build-frontend (push) Successful in 57s
ci / tests (push) Successful in 1m36s
ci / sonar (push) Successful in 4m40s

Updated the ImportManualInboxCommandHandler and ImportMoviesCommandHandler to replace direct storage interactions with the ManualInboxTaker, streamlining the import process. This change enhances code clarity and maintains consistency across media import functionalities. Additionally, refactored related tests to accommodate the new handler structure, ensuring robust testing of the import logic.
This commit is contained in:
Leonid Pershin
2026-07-28 10:46:21 +03:00
parent 287ed5aa12
commit 6ca629c13a
10 changed files with 204 additions and 219 deletions
@@ -37,7 +37,7 @@ public sealed class ManualInboxIntegrationTests(PostgresFixture fixture)
await using var db = fixture.CreateContext();
var result = await new ImportManualInboxCommandHandler(
db,
storage,
new ManualInboxTaker(db, storage),
Substitute.For<IMediaProcessingQueue>()
).Handle(
new ImportManualInboxCommand(
@@ -107,7 +107,7 @@ public sealed class ManualInboxIntegrationTests(PostgresFixture fixture)
await using var db = fixture.CreateContext();
var result = await new ImportManualInboxCommandHandler(
db,
storage,
new ManualInboxTaker(db, storage),
Substitute.For<IMediaProcessingQueue>()
).Handle(
new ImportManualInboxCommand(
@@ -142,7 +142,7 @@ public sealed class ManualInboxIntegrationTests(PostgresFixture fixture)
await using var db = fixture.CreateContext();
var result = await new ImportManualInboxCommandHandler(
db,
storage,
new ManualInboxTaker(db, storage),
Substitute.For<IMediaProcessingQueue>()
).Handle(
new ImportManualInboxCommand([new ManualImportItem(name, 4, 12)], showId),