private BlogPostViewModel MapViewModel(BlogMLPost blogML, BlogPostImportResult modification = null, List<string> unsavedUrls = null)
{
var model = new BlogPostViewModel
{
Title = blogML.PostName ?? blogML.Title,
MetaTitle = blogML.Title,
IntroText = blogML.Excerpt != null ? blogML.Excerpt.UncodedText : null,
LiveFromDate = blogML.DateCreated.ToLocalTime().Date,
LiveToDate = null,
DesirableStatus = ContentStatus.Published,
Content = blogML.Content != null ? blogML.Content.UncodedText : null
};
if (modification != null)
{
model.BlogUrl = modification.PageUrl;
model.Title = modification.Title;
}
else
{
model.BlogUrl = blogService.CreateBlogPermalink(blogML.PostName ?? blogML.Title, unsavedUrls);
}
return model;
}