Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some oversights regarding #344 and #346 #422

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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