Store path in database.

This commit is contained in:
2020-09-06 20:15:29 +01:00
parent 9ee547e83e
commit 4b86bbdab6
5 changed files with 620 additions and 272 deletions

View File

@@ -424,12 +424,29 @@ namespace RomRepoMgr.Core.Workers
fileModificationDate = date;
}
string filename;
string path = null;
if(rom.Name.Contains('\\'))
{
filename = Path.GetFileName(rom.Name.Replace('\\', '/'));
path = Path.GetDirectoryName(rom.Name.Replace('\\', '/'));
}
else if(rom.Name.Contains('/'))
{
filename = Path.GetFileName(rom.Name);
path = Path.GetDirectoryName(rom.Name);
}
else
filename = rom.Name;
newFilesByMachine.Add(new FileByMachine
{
File = file,
Machine = machine,
Name = rom.Name,
FileLastModification = fileModificationDate
Name = filename,
FileLastModification = fileModificationDate,
Path = path
});
if(hashCollision)