mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
refactor: centralize integration config in domain layer, fix OutputFormat enum serialization
- Move stored_integration_config(), build_audiobookshelf_config() to domain/settings_core.py
- Remove legacy fallback from stored_integration_config() (only config[integrations])
- Add load_audiobookshelf_config() as combined entry point
- PostConversionHooks reads config directly via stored_integration_config()
- WebUI imports from domain/settings_core instead of webui/routes/utils/settings
- Remove duplicate _build_abs_config() from PostConversionHooks
- Remove dead audiobookshelf code from infrastructure/exporters.py
- Remove duplicate audiobookshelf functions from webui/service.py
- Fix OutputFormat enum serialization in output_layout_service.py and conversion_executor.py
(f'{enum}' gave 'OutputFormat.WAV' instead of '.wav')
- Mock spaCy in test_returns_at_least_one_segment instead of loading real model
- Add 28 tests for PostConversionHooks and build_audiobookshelf_config
This commit is contained in:
@@ -7,8 +7,8 @@ from abogen.webui.service import (
|
||||
JobStatus,
|
||||
build_service,
|
||||
_JOB_LOGGER,
|
||||
build_audiobookshelf_metadata,
|
||||
)
|
||||
from abogen.domain.metadata_helpers import build_audiobookshelf_metadata
|
||||
|
||||
|
||||
def test_service_processes_job(tmp_path):
|
||||
@@ -233,7 +233,7 @@ def test_audiobookshelf_metadata_uses_book_number(tmp_path):
|
||||
},
|
||||
)
|
||||
|
||||
metadata = build_audiobookshelf_metadata(job)
|
||||
metadata = build_audiobookshelf_metadata(job.metadata_tags)
|
||||
|
||||
assert metadata["seriesName"] == "Example Saga"
|
||||
assert metadata["seriesSequence"] == "7"
|
||||
@@ -264,7 +264,7 @@ def test_audiobookshelf_metadata_normalizes_sequence_value(tmp_path):
|
||||
},
|
||||
)
|
||||
|
||||
metadata = build_audiobookshelf_metadata(job)
|
||||
metadata = build_audiobookshelf_metadata(job.metadata_tags)
|
||||
|
||||
assert metadata["seriesName"] == "Example Saga"
|
||||
assert metadata["seriesSequence"] == "7"
|
||||
@@ -295,6 +295,6 @@ def test_audiobookshelf_metadata_allows_decimal_sequence(tmp_path):
|
||||
},
|
||||
)
|
||||
|
||||
metadata = build_audiobookshelf_metadata(job)
|
||||
metadata = build_audiobookshelf_metadata(job.metadata_tags)
|
||||
|
||||
assert metadata["seriesSequence"] == "4.5"
|
||||
|
||||
Reference in New Issue
Block a user