|
|
@ -170,8 +170,29 @@ namespace FLocal.ImportConsole { |
|
|
|
} |
|
|
|
} |
|
|
|
int postId = int.Parse(data["Number"]); |
|
|
|
int postId = int.Parse(data["Number"]); |
|
|
|
try { |
|
|
|
try { |
|
|
|
if(inserts.ContainsKey(postId) || Config.instance.mainConnection.GetCountByConditions(Post.TableSpec.instance, new ComparisonCondition(Post.TableSpec.instance.getIdSpec(), ComparisonType.EQUAL, postId.ToString())) > 0) { |
|
|
|
if(inserts.ContainsKey(postId)) { |
|
|
|
Console.Write("-"); |
|
|
|
Console.Write("-"); |
|
|
|
|
|
|
|
} else if(Config.instance.mainConnection.GetCountByConditions(Post.TableSpec.instance, new ComparisonCondition(Post.TableSpec.instance.getIdSpec(), ComparisonType.EQUAL, postId.ToString())) > 0) { |
|
|
|
|
|
|
|
Post post = Post.LoadById(postId); |
|
|
|
|
|
|
|
if(post.title.StartsWith("%") || post.body.StartsWith("%")) { |
|
|
|
|
|
|
|
string title = data["Subject"]; |
|
|
|
|
|
|
|
string body = data["Body"]; |
|
|
|
|
|
|
|
inserts[postId] = () => { |
|
|
|
|
|
|
|
ChangeSetUtil.ApplyChanges( |
|
|
|
|
|
|
|
new UpdateChange( |
|
|
|
|
|
|
|
Post.TableSpec.instance, |
|
|
|
|
|
|
|
new Dictionary<string, AbstractFieldValue> { |
|
|
|
|
|
|
|
{ Post.TableSpec.FIELD_TITLE, new ScalarFieldValue(title) }, |
|
|
|
|
|
|
|
{ Post.TableSpec.FIELD_BODY, new ScalarFieldValue(body) }, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
post.id |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
Console.Write("+"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Console.Write("-"); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
int localMain = int.Parse(data["Local_Main"]); |
|
|
|
int localMain = int.Parse(data["Local_Main"]); |
|
|
|
int main = int.Parse(data["Main"]); |
|
|
|
int main = int.Parse(data["Main"]); |
|
|
|