Skip to content

Commit

Permalink
Added logging for duplicates uploaded via UI (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-j-green authored Oct 14, 2023
1 parent a190f31 commit a8bf5a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gaseous-server/Classes/ImportGames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static void ImportGameFile(string GameFileImportPath, IGDB.Models.Platfor
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);
Expand All @@ -75,6 +76,12 @@ public static void ImportGameFile(string GameFileImportPath, IGDB.Models.Platfor
}
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
{
Expand Down

0 comments on commit a8bf5a9

Please sign in to comment.