Skip to content

Commit

Permalink
Update FMInfoGen for the previous
Browse files Browse the repository at this point in the history
  • Loading branch information
FenPhoenix committed Aug 20, 2023
1 parent 4ae6dd4 commit 438c730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions FMScanner/Core/Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,19 @@ public Scanner(string sevenZipWorkingPath, string sevenZipExePath)

[PublicAPI]
public ScannedFMDataAndError
Scan(string mission, string tempPath, bool forceFullIfNew)
Scan(string mission, string tempPath, bool forceFullIfNew, string name)
{
return ScanMany(
new List<FMToScan> { new(path: mission, forceFullScan: forceFullIfNew) },
new List<FMToScan> { new(path: mission, forceFullScan: forceFullIfNew, displayName: name) },
tempPath, _scanOptions, null, CancellationToken.None)[0];
}

[PublicAPI]
public ScannedFMDataAndError
Scan(string mission, string tempPath, ScanOptions scanOptions, bool forceFullIfNew)
Scan(string mission, string tempPath, ScanOptions scanOptions, bool forceFullIfNew, string name)
{
return ScanMany(
new List<FMToScan> { new(path: mission, forceFullScan: forceFullIfNew) },
new List<FMToScan> { new(path: mission, forceFullScan: forceFullIfNew, name) },
tempPath, scanOptions, null, CancellationToken.None)[0];
}

Expand Down
8 changes: 4 additions & 4 deletions TestApps/FMInfoGen/FMInfoGen/FMScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ private static void WriteYaml(bool zips, string path, List<ScannedFMDataAndError
}

private static (string YamlPath, List<FMToScan> FMsToScan, ScanOptions ScanOptions)
GetScanData(bool zips)
GetScanData(bool zips)
{
var fmsList = (zips
? Core.View.GetFMArchives()
.Select(static f => new FMToScan(path: Path.Combine(Config.FMsPath, f), false))
.Select(static f => new FMToScan(path: Path.Combine(Config.FMsPath, f), false, f))
: Directory.GetDirectories(Paths.CurrentExtractedDir, "*", SearchOption.TopDirectoryOnly)
.Select(static f => new FMToScan(path: f, false)))
.Select(static f => new FMToScan(path: f, false, f)))
.ToList();

string yamlPath = GetYamlPath(zips);
Expand Down Expand Up @@ -212,7 +212,7 @@ internal static void ScanFM(string item, bool zip, string? yamlPathOverride = nu
string fmPath = zip
? Path.Combine(Config.FMsPath, item)
: Path.Combine(Paths.CurrentExtractedDir, item);
fmData = scanner.Scan(fmPath, Core.View.GetTempPath(), scanOptions, false);
fmData = scanner.Scan(fmPath, Core.View.GetTempPath(), scanOptions, false, item);
}

if (fmData.ScannedFMData == null) return;
Expand Down

0 comments on commit 438c730

Please sign in to comment.