Skip to content

Commit ac9a711

Browse files
NeWbY100claude
andcommitted
fix: route SRR Compare-tab dispatch to Core.Comparison.SRRFileData
After the rename to SRRFileData, both ReScene.NET.Models and ReScene.Core.Comparison contained types named SRRFileData. The disambiguation in FileCompareViewModel pointed at Models.SRRFileData, but FileCompareService.LoadFileData returns the Core.Comparison one, so the pattern match never fired and the Compare tab tree stayed empty when an SRR was loaded. Fully qualify the three sites. Also extends the acronym sweep to mid-identifier positions (matching the lib commit) — CreateSrrCommand→CreateSRRCommand, ShowIsoSelection →ShowISOSelection, etc. Lib submodule pointer bumped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a3b0135 commit ac9a711

19 files changed

Lines changed: 159 additions & 159 deletions

ReScene.Lib

Submodule ReScene.Lib updated 55 files

ReScene.NET/Helpers/ReleaseFileScanner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public static List<string> FindSampleFiles(string releaseDir)
161161
/// <returns>
162162
/// A list of SFV file paths found in subtitle subdirectories.
163163
/// </returns>
164-
public static List<string> FindSubtitleSfvFiles(string releaseDir)
164+
public static List<string> FindSubtitleSFVFiles(string releaseDir)
165165
{
166166
var sfvFiles = new List<string>();
167167

@@ -242,7 +242,7 @@ public static bool IsMusicRelease(string releaseDir)
242242
/// <returns>
243243
/// A list of existing RAR file paths referenced by the SFV.
244244
/// </returns>
245-
public static List<string> FindRarFilesFromSfv(string sfvPath)
245+
public static List<string> FindRarFilesFromSFV(string sfvPath)
246246
{
247247
string dir = Path.GetDirectoryName(sfvPath) ?? ".";
248248
var rarFiles = new List<string>();

ReScene.NET/Services/ISampleRestorerService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public ulong SampleSize
1010
{
1111
get; set;
1212
}
13-
public uint ExpectedCrc
13+
public uint ExpectedCRC
1414
{
1515
get; set;
1616
}
@@ -20,7 +20,7 @@ public interface ISampleRestorerService
2020
{
2121
public event EventHandler<SRSReconstructionProgressEventArgs>? Progress;
2222

23-
public List<SRSEntryInfo> GetSrsEntries(string srrFilePath);
23+
public List<SRSEntryInfo> GetSRSEntries(string srrFilePath);
2424

2525
public Task<SRSReconstructionResult> RestoreSampleAsync(
2626
string srrFilePath, string srsFileName,

ReScene.NET/Services/ISrrCreationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public Task<SRRCreationResult> CreateFromRarAsync(
6161
/// <returns>
6262
/// The creation result including success status and statistics.
6363
/// </returns>
64-
public Task<SRRCreationResult> CreateFromSfvAsync(
64+
public Task<SRRCreationResult> CreateFromSFVAsync(
6565
string outputPath,
6666
string sfvFilePath,
6767
IReadOnlyDictionary<string, string>? additionalFiles,

ReScene.NET/Services/SRRCreationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public Task<SRRCreationResult> CreateFromRarAsync(
2525
CancellationToken ct) => _writer.CreateAsync(outputPath, rarVolumePaths, storedFiles, options, ct);
2626

2727
/// <inheritdoc />
28-
public Task<SRRCreationResult> CreateFromSfvAsync(
28+
public Task<SRRCreationResult> CreateFromSFVAsync(
2929
string outputPath,
3030
string sfvFilePath,
3131
IReadOnlyDictionary<string, string>? additionalFiles,
3232
SRRCreationOptions options,
33-
CancellationToken ct) => _writer.CreateFromSfvAsync(outputPath, sfvFilePath, additionalFiles, options, ct);
33+
CancellationToken ct) => _writer.CreateFromSFVAsync(outputPath, sfvFilePath, additionalFiles, options, ct);
3434
}

ReScene.NET/Services/SampleRestorerService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public event EventHandler<SRSReconstructionProgressEventArgs>? Progress
1414
remove => _rebuilder.Progress -= value;
1515
}
1616

17-
public List<SRSEntryInfo> GetSrsEntries(string srrFilePath)
17+
public List<SRSEntryInfo> GetSRSEntries(string srrFilePath)
1818
{
1919
var srr = SRRFile.Load(srrFilePath);
2020
var entries = new List<SRSEntryInfo>();
@@ -51,7 +51,7 @@ public List<SRSEntryInfo> GetSrsEntries(string srrFilePath)
5151
SRSFileName = srsName,
5252
SampleFileName = fd.FileName,
5353
SampleSize = fd.SampleSize,
54-
ExpectedCrc = fd.CRC32
54+
ExpectedCRC = fd.CRC32
5555
});
5656
}
5757
}
@@ -85,7 +85,7 @@ public async Task<SRSReconstructionResult> RestoreSampleAsync(
8585
{
8686
return new SRSReconstructionResult(
8787
Success: false, CRCMatch: false,
88-
ExpectedCrc: 0, ActualCrc: 0,
88+
ExpectedCRC: 0, ActualCRC: 0,
8989
ExpectedSize: 0, ActualSize: 0,
9090
ErrorMessage: $"Could not extract '{srsFileName}' from SRR");
9191
}

ReScene.NET/ViewModels/CreatorViewModel.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ public CreatorViewModel(ISrrCreationService srrService, ISrsCreationService srsS
5757

5858
// Input
5959
[ObservableProperty]
60-
[NotifyCanExecuteChangedFor(nameof(CreateSrrCommand))]
60+
[NotifyCanExecuteChangedFor(nameof(CreateSRRCommand))]
6161
private string _inputPath = string.Empty;
6262

6363
[ObservableProperty]
64-
private bool _isSfvInput = true;
64+
private bool _isSFVInput = true;
6565

6666
// Stored Files
6767
public ObservableCollection<StoredFileItem> StoredFiles { get; } = [];
@@ -71,7 +71,7 @@ public CreatorViewModel(ISrrCreationService srrService, ISrsCreationService srsS
7171

7272
// Output
7373
[ObservableProperty]
74-
[NotifyCanExecuteChangedFor(nameof(CreateSrrCommand))]
74+
[NotifyCanExecuteChangedFor(nameof(CreateSRRCommand))]
7575
private string _outputPath = string.Empty;
7676

7777
// Options
@@ -82,16 +82,16 @@ public CreatorViewModel(ISrrCreationService srrService, ISrsCreationService srsS
8282
private bool _autoIncludeFiles = true;
8383

8484
[ObservableProperty]
85-
private bool _autoCreateSrs = true;
85+
private bool _autoCreateSRS = true;
8686

8787
[ObservableProperty]
88-
private bool _createVobsubSrr = true;
88+
private bool _createVobsubSRR = true;
8989

9090
[ObservableProperty]
9191
private bool _storeFixRar = true;
9292

9393
[ObservableProperty]
94-
private bool _computeOsoHashes;
94+
private bool _computeOSOHashes;
9595

9696
[ObservableProperty]
9797
private bool _generateLanguagesDiz = true;
@@ -107,7 +107,7 @@ public CreatorViewModel(ISrrCreationService srrService, ISrsCreationService srsS
107107
private string _progressMessage = string.Empty;
108108

109109
[ObservableProperty]
110-
[NotifyCanExecuteChangedFor(nameof(CreateSrrCommand))]
110+
[NotifyCanExecuteChangedFor(nameof(CreateSRRCommand))]
111111
private bool _isCreating;
112112

113113
[ObservableProperty]
@@ -133,7 +133,7 @@ partial void OnInputPathChanged(string value)
133133
{
134134
if (!string.IsNullOrWhiteSpace(value))
135135
{
136-
IsSfvInput = Path.GetExtension(value).Equals(".sfv", StringComparison.OrdinalIgnoreCase);
136+
IsSFVInput = Path.GetExtension(value).Equals(".sfv", StringComparison.OrdinalIgnoreCase);
137137
}
138138

139139
UpdateStoredNames();
@@ -204,12 +204,12 @@ private void RemoveStoredFile()
204204
[RelayCommand]
205205
private void RemoveAllStoredFiles() => StoredFiles.Clear();
206206

207-
private bool CanCreateSrr() => !IsCreating
207+
private bool CanCreateSRR() => !IsCreating
208208
&& !string.IsNullOrWhiteSpace(InputPath)
209209
&& !string.IsNullOrWhiteSpace(OutputPath);
210210

211-
[RelayCommand(CanExecute = nameof(CanCreateSrr))]
212-
private async Task CreateSrrAsync()
211+
[RelayCommand(CanExecute = nameof(CanCreateSRR))]
212+
private async Task CreateSRRAsync()
213213
{
214214
IsCreating = true;
215215
ShowProgress = true;
@@ -226,7 +226,7 @@ private async Task CreateSrrAsync()
226226
{
227227
AppName = string.IsNullOrWhiteSpace(AppName) ? null : AppName,
228228
AllowCompressed = AllowCompressed,
229-
ComputeOsoHashes = ComputeOsoHashes,
229+
ComputeOSOHashes = ComputeOSOHashes,
230230
GenerateLanguagesDiz = GenerateLanguagesDiz
231231
};
232232

@@ -237,13 +237,13 @@ private async Task CreateSrrAsync()
237237
string releaseDir = Path.GetDirectoryName(InputPath) ?? ".";
238238

239239
// Phase 1: Auto-create SRS files for samples
240-
if (AutoCreateSrs)
240+
if (AutoCreateSRS)
241241
{
242-
tempDir = await CreateSrsForSamplesAsync(releaseDir, _cts.Token);
242+
tempDir = await CreateSRSForSamplesAsync(releaseDir, _cts.Token);
243243
}
244244

245245
// Phase 2: Create nested SRRs for subtitle archives
246-
if (CreateVobsubSrr)
246+
if (CreateVobsubSRR)
247247
{
248248
await CreateVobsubSrrsAsync(releaseDir, options, tempDir ??= _tempDir.CreateTempDirectory(), _cts.Token);
249249
}
@@ -263,9 +263,9 @@ private async Task CreateSrrAsync()
263263
storedFiles[item.StoredName] = item.FullPath;
264264
}
265265

266-
if (IsSfvInput)
266+
if (IsSFVInput)
267267
{
268-
result = await _sRRService.CreateFromSfvAsync(
268+
result = await _sRRService.CreateFromSFVAsync(
269269
OutputPath, InputPath,
270270
storedFiles.Count > 0 ? storedFiles : null,
271271
options, _cts.Token);
@@ -391,7 +391,7 @@ private void AutoScanReleaseFiles()
391391

392392
// ── SRS auto-creation ───────────────────────────────────
393393

394-
private async Task<string?> CreateSrsForSamplesAsync(string releaseDir, CancellationToken ct)
394+
private async Task<string?> CreateSRSForSamplesAsync(string releaseDir, CancellationToken ct)
395395
{
396396
List<string> samples = ReleaseFileScanner.FindSampleFiles(releaseDir);
397397
if (samples.Count == 0)
@@ -449,7 +449,7 @@ private void AutoScanReleaseFiles()
449449

450450
private async Task CreateVobsubSrrsAsync(string releaseDir, SRRCreationOptions options, string tempDir, CancellationToken ct)
451451
{
452-
List<string> subtitleSfvs = ReleaseFileScanner.FindSubtitleSfvFiles(releaseDir);
452+
List<string> subtitleSfvs = ReleaseFileScanner.FindSubtitleSFVFiles(releaseDir);
453453
if (subtitleSfvs.Count == 0)
454454
{
455455
return;
@@ -467,7 +467,7 @@ private async Task CreateVobsubSrrsAsync(string releaseDir, SRRCreationOptions o
467467

468468
try
469469
{
470-
SRRCreationResult result = await _sRRService.CreateFromSfvAsync(
470+
SRRCreationResult result = await _sRRService.CreateFromSFVAsync(
471471
srrPath, sfvPath, null, options, ct);
472472

473473
if (result.Success)
@@ -513,7 +513,7 @@ private void StoreFixRarFile(string releaseDir)
513513
}
514514

515515
// Find RAR files referenced by the SFV
516-
List<string> rarFiles = ReleaseFileScanner.FindRarFilesFromSfv(sfvFiles[0]);
516+
List<string> rarFiles = ReleaseFileScanner.FindRarFilesFromSFV(sfvFiles[0]);
517517
if (rarFiles.Count != 1)
518518
{
519519
return;

ReScene.NET/ViewModels/FileCompareViewModel.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ private void PopulateTree(ObservableCollection<TreeNodeViewModel> roots, object
629629
{
630630
PopulateDetailedTree(roots, detailedBlocks, isLeft);
631631
}
632-
else if (data is Models.SRRFileData srrData)
632+
else if (data is ReScene.Core.Comparison.SRRFileData srrData)
633633
{
634634
PopulateSRRTree(roots, srrData, isLeft);
635635
}
@@ -684,7 +684,7 @@ private static void PopulateDetailedTree(ObservableCollection<TreeNodeViewModel>
684684
roots.Add(rootNode);
685685
}
686686

687-
private static void PopulateSRRTree(ObservableCollection<TreeNodeViewModel> roots, Models.SRRFileData srrData, bool isLeft)
687+
private static void PopulateSRRTree(ObservableCollection<TreeNodeViewModel> roots, ReScene.Core.Comparison.SRRFileData srrData, bool isLeft)
688688
{
689689
SRRFile srr = srrData.SRRFile;
690690

@@ -1272,31 +1272,31 @@ private void ShowProperties(CompareNodeData nodeData, ObservableCollection<Prope
12721272
case CompareNodeType.SRSFileInfo:
12731273
if (nodeData.Data is SRSFileDataBlock fd)
12741274
{
1275-
ShowSrsFileInfoProperties(properties, fd);
1275+
ShowSRSFileInfoProperties(properties, fd);
12761276
}
12771277

12781278
break;
12791279

12801280
case CompareNodeType.SRSTrack:
12811281
if (nodeData.Data is SRSTrackDataBlock track)
12821282
{
1283-
ShowSrsTrackProperties(properties, track, nodeData.FileName);
1283+
ShowSRSTrackProperties(properties, track, nodeData.FileName);
12841284
}
12851285

12861286
break;
12871287

12881288
case CompareNodeType.SRSContainerChunks:
12891289
if (nodeData.Data is SRSContainerChunk chunk)
12901290
{
1291-
ShowSrsContainerChunkProperties(properties, chunk);
1291+
ShowSRSContainerChunkProperties(properties, chunk);
12921292
}
12931293

12941294
break;
12951295

12961296
case CompareNodeType.OSOHash:
12971297
if (nodeData.Data is SRROsoHashBlock oso)
12981298
{
1299-
ShowOsoHashProperties(properties, oso);
1299+
ShowOSOHashProperties(properties, oso);
13001300
}
13011301

13021302
break;
@@ -1434,9 +1434,9 @@ private void ShowDetailedBlockProperties(ObservableCollection<PropertyItem> prop
14341434
}
14351435

14361436
var otherData = isLeft ? _rightData : _leftData;
1437-
if (otherData is Models.SRRFileData otherSrrData)
1437+
if (otherData is ReScene.Core.Comparison.SRRFileData otherSRRData)
14381438
{
1439-
foreach (List<RARDetailedBlock> volumeBlocks in otherSrrData.VolumeDetailedBlocks.Values)
1439+
foreach (List<RARDetailedBlock> volumeBlocks in otherSRRData.VolumeDetailedBlocks.Values)
14401440
{
14411441
RARDetailedBlock? match = volumeBlocks.FirstOrDefault(b =>
14421442
b.BlockType == block.BlockType && b.ItemName == block.ItemName);
@@ -1463,7 +1463,7 @@ private void ShowSRRArchiveProperties(ObservableCollection<PropertyItem> propert
14631463
AddComparedProperty(properties, "RAR Volumes", srr.RARFiles.Count.ToString(), "RAR Volumes Count");
14641464
AddComparedProperty(properties, "Stored Files", srr.StoredFiles.Count.ToString(), "Stored Files Count");
14651465
AddComparedProperty(properties, "Archived Files", srr.ArchivedFiles.Count.ToString(), "Archived Files Count");
1466-
AddComparedProperty(properties, "Header CRC Errors", srr.HeaderCrcMismatches.ToString(), "Header CRC Errors");
1466+
AddComparedProperty(properties, "Header CRC Errors", srr.HeaderCRCMismatches.ToString(), "Header CRC Errors");
14671467
AddComparedProperty(properties, "Has Comment", FileComparer.FormatBool(!string.IsNullOrEmpty(srr.ArchiveComment)), "Has Comment");
14681468

14691469
properties.Add(new PropertyItem { Name = "--- Reconstruction Hints ---", Value = "", IsSeparator = true });
@@ -1524,7 +1524,7 @@ private void ShowRAR4FileProperties(ObservableCollection<PropertyItem> propertie
15241524
properties.Add(new PropertyItem { Name = "Type", Value = header.IsDirectory ? "Directory" : "File" });
15251525
AddComparedProperty(properties, "Unpacked Size", $"{header.UnpackedSize:N0} bytes", "Unpacked Size");
15261526
AddComparedProperty(properties, "Packed Size", $"{header.PackedSize:N0} bytes", "Packed Size");
1527-
AddComparedProperty(properties, "CRC32", header.FileCrc.ToString("X8"), "CRC");
1527+
AddComparedProperty(properties, "CRC32", header.FileCRC.ToString("X8"), "CRC");
15281528
AddComparedProperty(properties, "Compression Method", FileComparer.GetCompressionMethodName((int?)header.CompressionMethod), "Compression Method");
15291529
properties.Add(new PropertyItem { Name = "Dictionary Size", Value = $"{header.DictionarySizeKB} KB" });
15301530
AddComparedProperty(properties, "Modified Time", header.ModifiedTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "N/A", "Modified Time");
@@ -1537,7 +1537,7 @@ private void ShowRAR5FileProperties(ObservableCollection<PropertyItem> propertie
15371537
properties.Add(new PropertyItem { Name = "File Name", Value = info.FileName });
15381538
properties.Add(new PropertyItem { Name = "Type", Value = info.IsDirectory ? "Directory" : "File" });
15391539
AddComparedProperty(properties, "Unpacked Size", $"{info.UnpackedSize:N0} bytes", "Unpacked Size");
1540-
AddComparedProperty(properties, "CRC32", info.FileCrc?.ToString("X8") ?? "N/A", "CRC");
1540+
AddComparedProperty(properties, "CRC32", info.FileCRC?.ToString("X8") ?? "N/A", "CRC");
15411541
AddComparedProperty(properties, "Compression Method", FileComparer.GetCompressionMethodName(info.CompressionMethod), "Compression Method");
15421542
properties.Add(new PropertyItem { Name = "Dictionary Size", Value = $"{info.DictionarySizeKB} KB" });
15431543
if (info.ModificationTime.HasValue)
@@ -1618,12 +1618,12 @@ private static void ShowRarVolumeProperties(ObservableCollection<PropertyItem> p
16181618
properties.Add(new PropertyItem
16191619
{
16201620
Name = "Header CRC",
1621-
Value = $"0x{rarFile.Crc:X4}",
1621+
Value = $"0x{rarFile.CRC:X4}",
16221622
ByteRange = new ByteRange { Offset = p, Length = 2 }
16231623
});
16241624
}
16251625

1626-
private void ShowSrsFileInfoProperties(ObservableCollection<PropertyItem> properties, SRSFileDataBlock fd)
1626+
private void ShowSRSFileInfoProperties(ObservableCollection<PropertyItem> properties, SRSFileDataBlock fd)
16271627
{
16281628
AddComparedProperty(properties, "App Name", fd.AppName, "App Name");
16291629

@@ -1651,7 +1651,7 @@ private void ShowSrsFileInfoProperties(ObservableCollection<PropertyItem> proper
16511651
});
16521652
}
16531653

1654-
private void ShowSrsTrackProperties(ObservableCollection<PropertyItem> properties, SRSTrackDataBlock track, string? trackName)
1654+
private void ShowSRSTrackProperties(ObservableCollection<PropertyItem> properties, SRSTrackDataBlock track, string? trackName)
16551655
{
16561656
List<PropertyDifference>? trackDiffs = trackName is not null ? GetTrackDiffs(trackName) : null;
16571657

@@ -1724,7 +1724,7 @@ private void ShowSrsTrackProperties(ObservableCollection<PropertyItem> propertie
17241724
});
17251725
}
17261726

1727-
private static void ShowSrsContainerChunkProperties(ObservableCollection<PropertyItem> properties, SRSContainerChunk chunk)
1727+
private static void ShowSRSContainerChunkProperties(ObservableCollection<PropertyItem> properties, SRSContainerChunk chunk)
17281728
{
17291729
properties.Add(new PropertyItem { Name = "Label", Value = chunk.Label });
17301730
properties.Add(new PropertyItem { Name = "Chunk ID", Value = chunk.ChunkId });
@@ -1734,7 +1734,7 @@ private static void ShowSrsContainerChunkProperties(ObservableCollection<Propert
17341734
properties.Add(new PropertyItem { Name = "Total Size", Value = $"{chunk.BlockSize:N0} bytes ({FormatUtilities.FormatSize(chunk.BlockSize)})" });
17351735
}
17361736

1737-
private static void ShowOsoHashProperties(ObservableCollection<PropertyItem> properties, SRROsoHashBlock oso)
1737+
private static void ShowOSOHashProperties(ObservableCollection<PropertyItem> properties, SRROsoHashBlock oso)
17381738
{
17391739
long p = oso.BlockPosition + 7; // skip base header (CRC + type + flags + headerSize)
17401740

0 commit comments

Comments
 (0)