From 7ca168269fc8cc76d900fba6c6d04d2b02287956 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 29 Aug 2019 13:45:21 -0400 Subject: [PATCH] log skipped loose files --- docs/release-notes.md | 6 +++--- src/SMAPI/Framework/SCore.cs | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 352198e0..500f2427 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,9 +9,9 @@ These changes have not been released yet. * Improved performance. * Rewrote launch script on Linux to improve compatibility (thanks to kurumushi and toastal!). * Improved mod scanning: - * Now ignores metadata files/folders like `__MACOSX` and `__folder_managed_by_vortex`. - * Now ignores content files like `.txt` or `.png`, which avoids missing-manifest errors in some common cases. - * Now detects XNB mods more accurately, and consolidates multi-folder XNB mods. + * Now ignores metadata files and folders (like `__MACOSX` and `__folder_managed_by_vortex`) and content files (like `.txt` or `.png`), which avoids missing-manifest errors in some common cases. + * Now detects XNB mods more accurately, and consolidates multi-folder XNB mods in logged messages. + * Added trace logs for skipped loose files so it's easier to troubleshoot player logs. * Save Backup now works in the background, to avoid affecting startup time for players with a large number of saves. * Duplicate-mod errors now show the mod version in each folder. * Updated mod compatibility list. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index c5dede01..fde28852 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -25,7 +25,6 @@ using StardewModdingAPI.Framework.ModLoading; using StardewModdingAPI.Framework.Patching; using StardewModdingAPI.Framework.Reflection; using StardewModdingAPI.Framework.Serialization; -using StardewModdingAPI.Internal; using StardewModdingAPI.Patches; using StardewModdingAPI.Toolkit; using StardewModdingAPI.Toolkit.Framework.Clients.WebApi; @@ -395,6 +394,13 @@ namespace StardewModdingAPI.Framework this.Monitor.Log("Loading mod metadata...", LogLevel.Trace); ModResolver resolver = new ModResolver(); + // log loose files + { + string[] looseFiles = new DirectoryInfo(this.ModsPath).GetFiles().Select(p => p.Name).ToArray(); + if (looseFiles.Any()) + this.Monitor.Log($" Ignored loose files: {string.Join(", ", looseFiles.OrderBy(p => p, StringComparer.InvariantCultureIgnoreCase))}", LogLevel.Trace); + } + // load manifests IModMetadata[] mods = resolver.ReadManifests(toolkit, this.ModsPath, modDatabase).ToArray();