From a8bf5a941201b5839bc974cfcf4e8b9e16a076bb Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:13:26 -0700 Subject: [PATCH] Added logging for duplicates uploaded via UI (#158) --- gaseous-server/Classes/ImportGames.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gaseous-server/Classes/ImportGames.cs b/gaseous-server/Classes/ImportGames.cs index 0124cd3..d172357 100644 --- a/gaseous-server/Classes/ImportGames.cs +++ b/gaseous-server/Classes/ImportGames.cs @@ -66,6 +66,7 @@ namespace gaseous_server.Classes DataTable importDB = db.ExecuteCMD(sql, dbDict); if ((Int64)importDB.Rows[0]["count"] > 0) { + // import source was the import directory if (GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory)) { Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - moving to " + Config.LibraryConfiguration.LibraryImportDuplicatesDirectory); @@ -75,6 +76,12 @@ namespace gaseous_server.Classes } File.Move(GameFileImportPath, Path.Combine(Config.LibraryConfiguration.LibraryImportDuplicatesDirectory, Path.GetFileName(GameFileImportPath)), true); } + + // import source was the upload directory + if (GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryUploadDirectory)) + { + Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - skipping import"); + } } else {