private static void internalLoadManifest(bool forceLocal = false, bool overrideThrottling = false) { if (File.Exists(ManifestLocation) && (forceLocal || (!OnlineContent.CanFetchContentThrottleCheck() && !overrideThrottling))) //Force local, or we can't online check and cannot override throttle { LoadManifestFromDisk(ManifestLocation); return; } var shouldNotFetch = forceLocal || (!overrideThrottling && !OnlineContent.CanFetchContentThrottleCheck()) && File.Exists(ManifestLocation); if (!shouldNotFetch) //this cannot be triggered if forceLocal is true { Log.Information(@"Fetching ASI manifest from online source"); var onlineManifest = OnlineContent.FetchRemoteString(@"https://me3tweaks.com/mods/asi/getmanifest?AllGames=1"); onlineManifest = onlineManifest.Trim(); try { File.WriteAllText(StagedManifestLocation, onlineManifest); } catch (Exception e) { Log.Error(@"Error writing cached ASI manifest to disk: " + e.Message); } try { ParseManifest(onlineManifest, true); } catch (Exception e) { Log.Error(@"Error parsing online manifest: " + e.Message); internalLoadManifest(true); //force local load instead } } else if (File.Exists(ManifestLocation)) { Log.Information(@"Loading ASI local manifest"); LoadManifestFromDisk(ManifestLocation, false); } else { //can't get manifest or local manifest. //Todo: some sort of handling here as we are running in panel startup Log.Error(@"Cannot load ASI manifest: Could not fetch online manifest and no local manifest exists"); } }