-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix file processing issue for newly added tracks #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e9bb805
refactor(core,vm): introduce per-file track values model and fix supp…
TimGels adf7ba7
refactor(vm): improve SelectedLanguage null warning log message
TimGels b172688
fix(processing): read track values from global config instead of per-…
TimGels 3db11a6
docs(core,vm): update comments to reflect global-value-read pattern
TimGels File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| using MatroskaBatchFlow.Core.Enums; | ||
|
|
||
| namespace MatroskaBatchFlow.Core.Models; | ||
|
|
||
| /// <summary> | ||
| /// Stores per-file track values that are initially populated from the MediaInfo scan. | ||
| /// The original scanned data is always available via <see cref="ScannedTrackInfo"/>. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// The batch configuration uses a dual-model approach for tracks: | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <see cref="Services.TrackConfiguration"/> - one per track index in the global collection. | ||
| /// Carries modification intent (<c>ShouldModify*</c> flags) and the effective values | ||
| /// (Name, Language, flags) that should be written, and is shared across all files. | ||
| /// </item> | ||
| /// <item> | ||
| /// <see cref="FileTrackValues"/> - one per track per file in <see cref="FileTrackConfiguration"/>. | ||
| /// Represents the scanned/current per-file values and indicates whether a given file actually | ||
| /// has a track at a particular index. | ||
| /// </item> | ||
| /// </list> | ||
| /// During command generation, <see cref="Services.MkvPropeditArgumentsGenerator"/> reads both | ||
| /// <c>ShouldModify*</c> and the values to write from the global track configuration, and uses | ||
| /// <see cref="FileTrackValues"/> only to determine per-file track existence and indexing. | ||
| /// </remarks> | ||
| public sealed class FileTrackValues | ||
| { | ||
| /// <summary> | ||
| /// The raw track information as returned by MediaInfo. | ||
| /// </summary> | ||
| public required MediaInfoResult.MediaInfo.TrackInfo ScannedTrackInfo { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The type of this track (Audio, Video, Text). | ||
| /// </summary> | ||
| public TrackType Type { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Zero-based index of this track within its type (e.g. 0 = first audio track). | ||
| /// </summary> | ||
| public int Index { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The track name as scanned from the file. | ||
| /// </summary> | ||
| public string Name { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// The track language as scanned from the file. | ||
| /// </summary> | ||
| public MatroskaLanguageOption Language { get; set; } = MatroskaLanguageOption.Undetermined; | ||
|
|
||
| /// <summary> | ||
| /// Whether this track has the default flag set. | ||
| /// </summary> | ||
| public bool Default { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether this track has the forced flag set. | ||
| /// </summary> | ||
| public bool Forced { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether this track is enabled (corresponds to the Matroska FlagEnabled element). | ||
| /// </summary> | ||
| public bool Enabled { get; set; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/MatroskaBatchFlow.Core/Services/MkvPropeditArgumentsGenerator.Logging.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using MatroskaBatchFlow.Core.Enums; | ||
| using Microsoft.Extensions.Logging; | ||
|
|
||
| namespace MatroskaBatchFlow.Core.Services; | ||
|
|
||
| /// <summary> | ||
| /// LoggerMessage definitions for <see cref="MkvPropeditArgumentsGenerator"/>. | ||
| /// </summary> | ||
| public sealed partial class MkvPropeditArgumentsGenerator | ||
| { | ||
| [LoggerMessage(Level = LogLevel.Warning, | ||
| Message = "Per-file {TrackType} track index {TrackIndex} exceeds global track count {GlobalTrackCount} for file: {FilePath}")] | ||
| private partial void LogPerFileTrackExceedsGlobalCount(string filePath, TrackType trackType, int trackIndex, int globalTrackCount); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.