Skip to content

Commit ff6601d

Browse files
authored
Some oversights regarding #344 and #346 (#422)
1 parent b19bb1f commit ff6601d

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

ModAssistant/Classes/External Interfaces/BeatSaver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static async Task<BeatSaverMap> GetMap(string id, string type, bool show
6060
map.response = beatsaver;
6161
if (type == "hash")
6262
{
63-
map.HashToDownload = id.ToLower();
63+
map.HashToDownload = id.ToLowerInvariant();
6464
}
6565
else
6666
{

ModAssistant/Classes/Themes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void LoadThemes()
8181
FileInfo info = new FileInfo(file);
8282
string name = Path.GetFileNameWithoutExtension(info.Name);
8383

84-
if (info.Extension.ToLower().Equals(".mat"))
84+
if (info.Extension.ToLowerInvariant().Equals(".mat"))
8585
{
8686
Theme theme = LoadZipTheme(ThemeDirectory, name, ".mat");
8787
if (theme is null) continue;

ModAssistant/Classes/Utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public static void Log(string message, string severity = "LOG")
436436
{
437437
string path = Path.GetDirectoryName(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath);
438438
string logFile = $"{path}{Path.DirectorySeparatorChar}log.log";
439-
File.AppendAllText(logFile, $"[{DateTime.UtcNow:yyyy-mm-dd HH:mm:ss.ffffff}][{severity.ToUpper()}] {message}\n");
439+
File.AppendAllText(logFile, $"[{DateTime.UtcNow:yyyy-mm-dd HH:mm:ss.ffffff}][{severity.ToUpperInvariant()}] {message}\n");
440440
}
441441

442442
public static async Task<string> Download(string link, string folder, string output, bool preferContentDisposition = false)

ModAssistant/Pages/Mods.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed partial class Mods : Page
2828
public Mod[] ModsList;
2929
public Mod[] AllModsList;
3030
public static List<Mod> InstalledMods = new List<Mod>();
31-
public static List<Mod> LibsToMatch = new List<Mod>();
31+
public static List<Mod> ManifestsToMatch = new List<Mod>();
3232
public List<string> CategoryNames = new List<string>();
3333
public CollectionView view;
3434
public bool PendingChanges;
@@ -178,22 +178,25 @@ private void CheckInstallDir(string directory)
178178
{
179179
string fileExtension = Path.GetExtension(file);
180180

181-
if (File.Exists(file) && (fileExtension == ".dll" || fileExtension == ".manifest"))
181+
if (File.Exists(file) && (fileExtension == ".dll" || fileExtension == ".exe" || fileExtension == ".manifest"))
182182
{
183183
Mod mod = GetModFromHash(Utils.CalculateMD5(file));
184184
if (mod != null)
185185
{
186186
if (fileExtension == ".manifest")
187187
{
188-
LibsToMatch.Add(mod);
188+
ManifestsToMatch.Add(mod);
189189
}
190190
else
191191
{
192192
if (directory.Contains("Libs"))
193193
{
194-
if (!LibsToMatch.Contains(mod)) continue;
194+
if (!ManifestsToMatch.Contains(mod))
195+
{
196+
continue;
197+
}
195198

196-
LibsToMatch.Remove(mod);
199+
ManifestsToMatch.Remove(mod);
197200
}
198201

199202
AddDetectedMod(mod);

ModAssistant/Pages/Options.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private async void YeetBSIPAButton_Click(object sender, RoutedEventArgs e)
278278
}
279279
foreach (Mod mod in Mods.InstalledMods)
280280
{
281-
if (mod.name.ToLower() == "bsipa")
281+
if (mod.name.ToLowerInvariant() == "bsipa")
282282
{
283283
Mods.Instance.UninstallMod(mod);
284284
break;

0 commit comments

Comments
 (0)