Skip to content

Commit

Permalink
Update WoWNamingLib
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Mar 17, 2024
1 parent 4ac7361 commit 0ee3270
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Controllers/CASCController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,26 @@ public async Task<string> CheckFiles()
return string.Join('\n', results);
}

[Route("checkFilesFromFile")]
[HttpGet]
public async Task<string> CheckFilesFromFile(string file = "")
{
var filenames = System.IO.File.ReadAllLines(file);
var unknownFDIDs = CASC.Listfile.Where(x => x.Value == "").Select(x => x.Key).ToList();
var reverseLookup = CASC.LookupMap.ToDictionary(x => x.Value, x => x.Key);
var hasher = new Jenkins96();
var results = new List<string>();
foreach (var filename in filenames)
{
var lookup = hasher.ComputeHash(filename.Trim());
if (reverseLookup.TryGetValue(lookup, out var unkFDID))
{
results.Add(unkFDID + ";" + filename);
}
}
return string.Join('\n', results);
}

[Route("fileCheck")]
[HttpGet]
public bool FileCheck(string search)
Expand Down
2 changes: 1 addition & 1 deletion WoWNamingLib

0 comments on commit 0ee3270

Please sign in to comment.