Skip to content

Commit

Permalink
Some oversights regarding bsmg#344 and bsmg#346 (bsmg#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meivyn authored and kcrg committed Feb 23, 2022
1 parent 0c0781a commit 2a9a683
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ModAssistant/Classes/External Interfaces/BeatSaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static async Task<BeatSaverMap> GetMap(string id, string type, bool show
map.response = beatsaver;
if (type == "hash")
{
map.HashToDownload = id.ToLower();
map.HashToDownload = id.ToLowerInvariant();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion ModAssistant/Classes/Themes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void LoadThemes()
FileInfo info = new FileInfo(file);
string name = Path.GetFileNameWithoutExtension(info.Name);

if (info.Extension.ToLower().Equals(".mat"))
if (info.Extension.ToLowerInvariant().Equals(".mat"))
{
Theme theme = LoadZipTheme(ThemeDirectory, name, ".mat");
if (theme is null)
Expand Down
2 changes: 1 addition & 1 deletion ModAssistant/Classes/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public static void Log(string message, string severity = "LOG")
{
string path = Path.GetDirectoryName(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath);
string logFile = $"{path}{Path.DirectorySeparatorChar}log.log";
File.AppendAllText(logFile, $"[{DateTime.UtcNow:yyyy-mm-dd HH:mm:ss.ffffff}][{severity.ToUpper()}] {message}\n");
File.AppendAllText(logFile, $"[{DateTime.UtcNow:yyyy-mm-dd HH:mm:ss.ffffff}][{severity.ToUpperInvariant()}] {message}\n");
}

public static async Task<string> Download(string link, string folder, string output, bool preferContentDisposition = false)
Expand Down
10 changes: 5 additions & 5 deletions ModAssistant/Pages/Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public sealed partial class Mods : Page
public Mod[] ModsList;
public Mod[] AllModsList;
public static List<Mod> InstalledMods = new List<Mod>();
public static List<Mod> LibsToMatch = new List<Mod>();
public static List<Mod> ManifestsToMatch = new List<Mod>();
public List<string> CategoryNames = new List<string>();
public CollectionView view;
public bool PendingChanges;
Expand Down Expand Up @@ -186,25 +186,25 @@ private void CheckInstallDir(string directory)
{
string fileExtension = Path.GetExtension(file);

if (File.Exists(file) && (fileExtension == ".dll" || fileExtension == ".manifest"))
if (File.Exists(file) && (fileExtension == ".dll" || fileExtension == ".exe" || fileExtension == ".manifest"))
{
Mod mod = GetModFromHash(Utils.CalculateMD5(file));
if (mod != null)
{
if (fileExtension == ".manifest")
{
LibsToMatch.Add(mod);
ManifestsToMatch.Add(mod);
}
else
{
if (directory.Contains("Libs"))
{
if (!LibsToMatch.Contains(mod))
if (!ManifestsToMatch.Contains(mod))
{
continue;
}

LibsToMatch.Remove(mod);
ManifestsToMatch.Remove(mod);
}

AddDetectedMod(mod);
Expand Down
2 changes: 1 addition & 1 deletion ModAssistant/Pages/Options.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private async void YeetBSIPAButton_Click(object sender, RoutedEventArgs e)
}
foreach (Mod mod in Mods.InstalledMods)
{
if (mod.name.ToLower() == "bsipa")
if (mod.name.ToLowerInvariant() == "bsipa")
{
Mods.Instance.UninstallMod(mod);
break;
Expand Down

0 comments on commit 2a9a683

Please sign in to comment.