Commit a0ef209a LN

数据源匹配后重新生成reelID

1 个父辈 ed886837
...@@ -226,6 +226,7 @@ namespace BLL ...@@ -226,6 +226,7 @@ namespace BLL
{ {
key.Add(config.ReelIDKeyWord, Reelidstr); key.Add(config.ReelIDKeyWord, Reelidstr);
} }
LogNet.log.Info($"重设{config.ReelIDKeyWord}={Reelidstr}");
} }
...@@ -276,7 +277,25 @@ namespace BLL ...@@ -276,7 +277,25 @@ namespace BLL
key = ExtraFileData.MatchFileData(key, out bool findOk); key = ExtraFileData.MatchFileData(key, out bool findOk);
bool hasDataSource = (!string.IsNullOrEmpty(Config.DataSource_DataKey)) || bool hasDataSource = (!string.IsNullOrEmpty(Config.DataSource_DataKey)) ||
(Config.DataSource_DataKey_Others.Val != null && Config.DataSource_DataKey_Others.Val.Length > 0); (Config.DataSource_DataKey_Others.Val != null && Config.DataSource_DataKey_Others.Val.Length > 0);
if (findOk)
{
// 添加或替换自增ID
if (!string.IsNullOrEmpty(config.ReelIDKeyWord) && isdisplay)
{
var Reelidstr = GetReelid();
if (key.ContainsKey(config.ReelIDKeyWord))
{
key[config.ReelIDKeyWord] = Reelidstr;
}
else
{
key.Add(config.ReelIDKeyWord, Reelidstr);
}
LogNet.log.Info($"匹配到外部数据源,重设{config.ReelIDKeyWord}={Reelidstr}");
}
}
if (hasDataSource && ExtraFileData.hasFileData() && (!findOk) && Config.DataSource_CanReMatch) if (hasDataSource && ExtraFileData.hasFileData() && (!findOk) && Config.DataSource_CanReMatch)
{ {
CheckText("ReMatch_Show"); CheckText("ReMatch_Show");
......
...@@ -471,11 +471,18 @@ namespace BLL ...@@ -471,11 +471,18 @@ namespace BLL
private static Dictionary<string,string> UpdateData(Dictionary<string, string> key,Dictionary<string,string> findDataMap,Dictionary<string,string> otherKeys) private static Dictionary<string,string> UpdateData(Dictionary<string, string> key,Dictionary<string,string> findDataMap,Dictionary<string,string> otherKeys)
{ {
Dictionary<string, string> titleKey = new Dictionary<string, string>(); Dictionary<string, List<string>> titleKey = new Dictionary<string, List<string>>();
foreach (string otherKey in otherKeys.Keys) foreach (string otherKey in otherKeys.Keys)
{ {
string value = otherKeys[otherKey]; string value = otherKeys[otherKey];
titleKey[value] = otherKey; List<string> mcodes = new List<string>();
titleKey.TryGetValue(value, out mcodes);
if (mcodes == null)
{
mcodes = new List<string>();
}
mcodes.Add(otherKey);
titleKey[value] = mcodes;
} }
...@@ -485,8 +492,10 @@ namespace BLL ...@@ -485,8 +492,10 @@ namespace BLL
{ {
if (titleKey.ContainsKey(d.Key)) if (titleKey.ContainsKey(d.Key))
{ {
string softKey = titleKey[d.Key]; foreach(string softKey in titleKey[d.Key])
key[softKey] = d.Value; {
key[softKey] = d.Value;
}
} }
else else
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!