Skip to content

Commit

Permalink
Some oversights regarding bsmg#344 and bsmg#346
Browse files Browse the repository at this point in the history
  • Loading branch information
Meivyn committed Dec 2, 2021
1 parent c0abb58 commit 44d47e5
Show file tree
Hide file tree
Showing 5 changed files with 12 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 @@ -60,7 +60,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) continue;
Expand Down
2 changes: 1 addition & 1 deletion ModAssistant/Classes/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,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
13 changes: 8 additions & 5 deletions ModAssistant/Pages/Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 @@ -178,22 +178,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)) continue;
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 @@ -278,7 +278,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 44d47e5

Please sign in to comment.