Removed unnecessary compiler instantiation for setting downloads folder

This commit is contained in:
Justin Swanson 2019-11-23 18:36:57 -06:00
parent 3a15d62289
commit df62c2ff8c
2 changed files with 5 additions and 14 deletions

View File

@ -55,11 +55,13 @@ namespace Wabbajack.Lib
if (MO2Ini.Settings != null)
if (MO2Ini.Settings.download_directory != null)
return MO2Ini.Settings.download_directory.Replace("/", "\\");
return Path.Combine(MO2Folder, "downloads");
return GetTypicalDownloadsFolder(MO2Folder);
}
set => _mo2DownloadsFolder = value;
}
public static string GetTypicalDownloadsFolder(string mo2Folder) => Path.Combine(mo2Folder, "downloads");
public string MO2ProfileDir => Path.Combine(MO2Folder, "profiles", MO2Profile);
internal UserStatus User { get; private set; }

View File

@ -182,20 +182,9 @@ namespace Wabbajack
.FilterSwitch(
this.WhenAny(x => x.DownloadLocation.Exists)
.Invert())
.Subscribe(x =>
.Subscribe(_ =>
{
try
{
var tmpCompiler = new MO2Compiler(
mo2Folder: Mo2Folder,
mo2Profile: null,
outputFile: null);
DownloadLocation.TargetPath = tmpCompiler.MO2DownloadsFolder;
}
catch (Exception ex)
{
Utils.Log($"Error setting default download location {ex}");
}
DownloadLocation.TargetPath = MO2Compiler.GetTypicalDownloadsFolder(Mo2Folder);
})
.DisposeWith(CompositeDisposable);
}