mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
fix endorsing for real
This commit is contained in:
parent
d33c1a358d
commit
9c87af84d6
@ -440,7 +440,8 @@ namespace Wabbajack
|
||||
{
|
||||
GameName = general.gameName,
|
||||
FileID = general.fileID,
|
||||
ModID = general.modID
|
||||
ModID = general.modID,
|
||||
Version = general.version ?? "0.0.0.0"
|
||||
};
|
||||
Status($"Getting Nexus info for {found.Name}");
|
||||
try
|
||||
|
@ -174,6 +174,7 @@ namespace Wabbajack
|
||||
public string GameName;
|
||||
public string ModID;
|
||||
public string FileID;
|
||||
public string Version;
|
||||
}
|
||||
|
||||
public class GoogleDriveMod : Archive
|
||||
|
@ -79,6 +79,7 @@ namespace Wabbajack
|
||||
|
||||
public void Install()
|
||||
{
|
||||
|
||||
Directory.CreateDirectory(Outputfolder);
|
||||
Directory.CreateDirectory(DownloadFolder);
|
||||
|
||||
@ -120,14 +121,14 @@ namespace Wabbajack
|
||||
|
||||
private void AskToEndorse()
|
||||
{
|
||||
var mods = ModList.Directives
|
||||
var mods = ModList.Archives
|
||||
.OfType<NexusMod>()
|
||||
.GroupBy(f => (f.GameName, f.ModID))
|
||||
.Select(mod => mod.First())
|
||||
.ToArray();
|
||||
|
||||
var result = MessageBox.Show(
|
||||
$"Installation has completed, but you have installed ${mods.Length} from the Nexus, would you like to" +
|
||||
$"Installation has completed, but you have installed {mods.Length} from the Nexus, would you like to" +
|
||||
" endorse these mods to show support to the authors? It will only take a few moments.", "Endorse Mods?",
|
||||
MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
|
||||
@ -144,7 +145,11 @@ namespace Wabbajack
|
||||
mods[b] = tmp;
|
||||
}
|
||||
|
||||
mods.PMap(mod => NexusAPI.EndorseMod(mod, NexusAPIKey));
|
||||
mods.PMap(mod =>
|
||||
{
|
||||
var er = NexusAPI.EndorseMod(mod, NexusAPIKey);
|
||||
Utils.Log($"Endorsed {mod.GameName} - {mod.ModID} - Result: {er.message}");
|
||||
});
|
||||
Info("Done! You may now exit the application!");
|
||||
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ namespace Wabbajack
|
||||
var url = $"https://api.nexusmods.com/v1/games/{ConvertGameName(mod.GameName)}/mods/{mod.ModID}/endorse.json";
|
||||
var client = BaseNexusClient(apikey);
|
||||
|
||||
var content = new FormUrlEncodedContent(new Dictionary<string, string>() {{"value", "\"\""}});
|
||||
var content = new FormUrlEncodedContent(new Dictionary<string, string>() {{"version", mod.Version}});
|
||||
|
||||
using (var s = client.PostStreamSync(url, content))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user