Added logging for duplicates uploaded via UI (#158)
This commit is contained in:
@@ -66,6 +66,7 @@ namespace gaseous_server.Classes
|
|||||||
DataTable importDB = db.ExecuteCMD(sql, dbDict);
|
DataTable importDB = db.ExecuteCMD(sql, dbDict);
|
||||||
if ((Int64)importDB.Rows[0]["count"] > 0)
|
if ((Int64)importDB.Rows[0]["count"] > 0)
|
||||||
{
|
{
|
||||||
|
// import source was the import directory
|
||||||
if (GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory))
|
if (GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory))
|
||||||
{
|
{
|
||||||
Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - moving to " + Config.LibraryConfiguration.LibraryImportDuplicatesDirectory);
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user