mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fixed NexusDownloader.Verify to work with non MO2 games
This commit is contained in:
parent
bb2b199d34
commit
8fd65da191
@ -100,10 +100,21 @@ namespace Wabbajack.Lib.Downloaders
|
||||
{
|
||||
try
|
||||
{
|
||||
var modfiles = new NexusApiClient().GetModFiles(GameRegistry.GetByMO2ArchiveName(GameName).Game, int.Parse(ModID));
|
||||
var fileid = ulong.Parse(FileID);
|
||||
var found = modfiles.files
|
||||
.FirstOrDefault(file => file.file_id == fileid && file.category_name != null);
|
||||
var gameMeta = GameRegistry.GetByMO2ArchiveName(GameName) ?? GameRegistry.GetByNexusName(GameName);
|
||||
if (gameMeta == null)
|
||||
return false;
|
||||
|
||||
var game = gameMeta.Game;
|
||||
if (!int.TryParse(ModID, out var modID))
|
||||
return false;
|
||||
|
||||
var modFiles = new NexusApiClient().GetModFiles(game, modID);
|
||||
|
||||
if (!ulong.TryParse(FileID, out var fileID))
|
||||
return false;
|
||||
|
||||
var found = modFiles.files
|
||||
.FirstOrDefault(file => file.file_id == fileID && file.category_name != null);
|
||||
return found != null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Loading…
Reference in New Issue
Block a user