Ok ricerca preliminare tags da file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user