Duplicate imported files are now sent to a duplicates folder
This commit is contained in:
@@ -66,9 +66,14 @@ namespace gaseous_server.Classes
|
||||
DataTable importDB = db.ExecuteCMD(sql, dbDict);
|
||||
if ((Int64)importDB.Rows[0]["count"] > 0)
|
||||
{
|
||||
if (!GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory))
|
||||
if (GameFileImportPath.StartsWith(Config.LibraryConfiguration.LibraryImportDirectory))
|
||||
{
|
||||
Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - skipping");
|
||||
Logging.Log(Logging.LogType.Warning, "Import Game", " " + GameFileImportPath + " already in database - moving to " + Config.LibraryConfiguration.LibraryImportDuplicatesDirectory);
|
||||
if (!Directory.Exists(Config.LibraryConfiguration.LibraryImportDuplicatesDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(Config.LibraryConfiguration.LibraryImportDuplicatesDirectory);
|
||||
}
|
||||
File.Move(GameFileImportPath, Path.Combine(Config.LibraryConfiguration.LibraryImportDuplicatesDirectory, Path.GetFileName(GameFileImportPath)), true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -346,13 +346,29 @@ namespace gaseous_tools
|
||||
}
|
||||
}
|
||||
|
||||
// public string LibraryDataDirectory
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return Path.Combine(LibraryRootDirectory, "Library");
|
||||
// }
|
||||
// }
|
||||
public string LibraryImportErrorDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(LibraryRootDirectory, "Import Errors");
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryImportDuplicatesDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(LibraryImportErrorDirectory, "Duplicates");
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryImportGeneralErrorDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(LibraryImportErrorDirectory, "Error");
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryBIOSDirectory
|
||||
{
|
||||
|
Reference in New Issue
Block a user