Skip to content

Refactor track management to use TrackIntent model#91

Merged
TimGels merged 2 commits intomainfrom
refactor/track-intent-architecture
May 2, 2026
Merged

Refactor track management to use TrackIntent model#91
TimGels merged 2 commits intomainfrom
refactor/track-intent-architecture

Conversation

@TimGels
Copy link
Copy Markdown
Owner

@TimGels TimGels commented May 2, 2026

Adopt a unified TrackIntent model for batch processing, simplifying track state management and enhancing metadata handling. This change removes legacy configurations, streamlines initialization, and improves the overall architecture for future enhancements. Focused tests ensure the integrity of the new implementation.

TimGels added 2 commits May 2, 2026 16:39
- replace the legacy TrackConfiguration/FileTrackConfiguration/FileTrackValues split
  with a single TrackIntent model owned per batch track slot
- remove duplicated mutable per-file track state and treat scanned files as the source
  of truth for per-file availability and ordering
- add ScannedFileInfo.GetTracks(TrackType) so initialization, rule evaluation, and
  mkvpropedit argument generation share one canonical ordered track lookup path
- replace TrackConfigurationFactory with TrackIntentFactory and update dependency
  registration to build TrackIntent instances directly from scanned metadata
- simplify BatchConfiguration by exposing only global TrackIntent collections and
  removing file-configuration migration/indexing code that belonged to the old model

- keep the design centered on batch intent rather than per-file mirrored state:
  the batch owns the desired values and ShouldModify* flags, while each file contributes
  only scanned metadata and track presence
- preserve uneven track-count support by treating TrackIntent.Index as the stable global
  slot and skipping missing tracks at resolution time instead of maintaining placeholder
  per-file config objects
- make command generation more direct and predictable by reading mkvpropedit output
  straight from TrackIntent values and resolving file applicability from scanned tracks
  on demand
- separate stable batch intent from scanned per-file metadata so future resolution
  strategies can evolve without reintroducing mirrored mutable state
- keep today’s model intentionally simple while leaving room for later policy layers,
  smarter defaulting, per-file override strategies, or more advanced track-resolution logic

- update naming, default, forced, and language rules to derive values from the current
  batch file set through canonical scanned track lookup
- normalize language aggregation through ILanguageProvider and ISO 639-2/B grouping so
  aliases such as en/eng are counted as the same language
- simplify track view models and XAML bindings to edit TrackIntent directly instead of
  synchronizing separate global and per-file models
- remove obsolete TrackPositionRule and legacy-model tests that only existed to support
  the old architecture

- fix the import-time derived-default regression introduced by the refactor by adding
  scanned files to the batch before InitializeTrackConfigStage applies aggregate rules
- add orchestrator regression coverage for both the pipeline order and the real import
  behavior so derived defaults are verified against all files imported in the same run
- add focused tests for TrackIntentFactory, ScannedFileInfo ordered track lookup,
  mkvpropedit argument generation, normalized language defaulting, and stale refresh
  replacement behavior
- refresh assistant/project metadata to document the TrackIntent architecture and the
  current track-configuration flow
@TimGels TimGels merged commit de50665 into main May 2, 2026
6 checks passed
@TimGels TimGels deleted the refactor/track-intent-architecture branch May 2, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant