From a6b0c85ad0b4d98cd7c26d2ced1e3c34a628d0fa Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Fri, 26 May 2023 23:25:38 +1000 Subject: [PATCH] refactor: added an array of files to skip during import --- gaseous-server/Classes/ImportGames.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gaseous-server/Classes/ImportGames.cs b/gaseous-server/Classes/ImportGames.cs index d05d39c..e5cea16 100644 --- a/gaseous-server/Classes/ImportGames.cs +++ b/gaseous-server/Classes/ImportGames.cs @@ -42,9 +42,13 @@ namespace gaseous_server.Classes string sql = ""; Dictionary dbDict = new Dictionary(); - if (String.Equals(Path.GetFileName(GameFileImportPath),".DS_STORE", StringComparison.OrdinalIgnoreCase)) + string[] SkippableFiles = { + ".DS_STORE", + "desktop.ini" + }; + if (SkippableFiles.Contains(Path.GetFileName(GameFileImportPath), StringComparer.OrdinalIgnoreCase)) { - Logging.Log(Logging.LogType.Information, "Import Game", "Skipping item " + GameFileImportPath); + Logging.Log(Logging.LogType.Debug, "Import Game", "Skipping item " + GameFileImportPath); } else { @@ -63,7 +67,7 @@ namespace gaseous_server.Classes { if (!GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory)) { - Logging.Log(Logging.LogType.Information, "Import Game", " " + GameFileImportPath + " already in database - skipping"); + Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - skipping"); } } else