Ok ricerca preliminare tags da file

This commit is contained in:
Samuele Locatelli
2021-09-08 10:41:23 +02:00
parent 82736ca983
commit 0f2013c75f
3 changed files with 89 additions and 2 deletions
+19 -1
View File
@@ -244,11 +244,29 @@ namespace MP.FileData.Controllers
FileContent = File.ReadAllBytes(o.FullName)
}).ToList();
// calcolo MD5
List<string> excludeTags = new List<string>() { "M4", "M5", "M4+A", "M4+B", "M5+A", "M5+B" };
// calcolo MD5 e tags
foreach (var item in newRec)
{
var hash = md5.ComputeHash(item.FileContent);
item.MD5 = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
List<string> Tags = new List<string>();
// cerco codice tag come nome file(TAG) nei primi 500 char
string code2search = "";
if (item.FileStringContent.Length > 200)
{
code2search = item.FileStringContent.Substring(0, 200);
}
else
{
code2search = item.FileStringContent;
}
Tags = TagsUtils.searchProgComment(item.Name, code2search, excludeTags);
//// aggiungo i tags SE non ci fossero
//item.Tags = Tags;
}
// aggiungo in blocco