remove database, use in-memory
This commit is contained in:
29
MareSynchronos/FileCache/FileCache.cs
Normal file
29
MareSynchronos/FileCache/FileCache.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
#nullable disable
|
||||
|
||||
|
||||
using MareSynchronos;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MareSynchronos.FileCache;
|
||||
|
||||
public class FileCache
|
||||
{
|
||||
public string ResolvedFilepath { get; private set; }
|
||||
public string Hash { get; set; }
|
||||
public string PrefixedFilePath { get; init; }
|
||||
public string LastModifiedDateTicks { get; init; }
|
||||
|
||||
public FileCache(string hash, string path, string lastModifiedDateTicks)
|
||||
{
|
||||
Hash = hash;
|
||||
PrefixedFilePath = path;
|
||||
LastModifiedDateTicks = lastModifiedDateTicks;
|
||||
}
|
||||
|
||||
public void SetResolvedFilePath(string filePath)
|
||||
{
|
||||
ResolvedFilepath = filePath.ToLowerInvariant().Replace("\\\\", "\\");
|
||||
}
|
||||
|
||||
public string CsvEntry => $"{Hash}{FileCacheManager.CsvSplit}{PrefixedFilePath}{FileCacheManager.CsvSplit}{LastModifiedDateTicks.ToString(CultureInfo.InvariantCulture)}";
|
||||
}
|
||||
Reference in New Issue
Block a user