Skip to content

track_base

Base class for music processing modules.

Provides common functionality and structure for all music processing modules including genre management, year retrieval, and track processing.

BaseProcessor

BaseProcessor(
    console_logger, error_logger, analytics, config, dry_run
)

Base class for music processing modules.

Provides common initialization and dry-run functionality that is shared across all processing modules.

Initialize the base processor.

Parameters:

Name Type Description Default
console_logger Logger

Logger for console output

required
error_logger Logger

Logger for error messages

required
analytics AnalyticsProtocol

Service for performance tracking

required
config AppConfig

Typed application configuration

required
dry_run bool

Whether to run in dry-run mode

required
Source code in src/core/tracks/track_base.py
def __init__(
    self,
    console_logger: logging.Logger,
    error_logger: logging.Logger,
    analytics: AnalyticsProtocol,
    config: AppConfig,
    dry_run: bool,
) -> None:
    """Initialize the base processor.

    Args:
        console_logger: Logger for console output
        error_logger: Logger for error messages
        analytics: Service for performance tracking
        config: Typed application configuration
        dry_run: Whether to run in dry-run mode

    """
    self.console_logger = console_logger
    self.error_logger = error_logger
    self.analytics = analytics
    self.config = config
    self.dry_run = dry_run
    self._dry_run_actions: list[dict[str, Any]] = []

get_dry_run_actions

get_dry_run_actions()

Get the list of dry-run actions performed.

Returns:

Type Description
list[dict[str, Any]]

List of dry-run actions with details

Source code in src/core/tracks/track_base.py
def get_dry_run_actions(self) -> list[dict[str, Any]]:
    """Get the list of dry-run actions performed.

    Returns:
        List of dry-run actions with details

    """
    return self._dry_run_actions.copy()