Actually set the labels from categories

This commit is contained in:
Scott Lovegrove 2015-12-23 16:58:31 +00:00
parent 2435a48763
commit 76d5d785ea
1 changed files with 3 additions and 1 deletions

View File

@ -107,10 +107,12 @@ namespace OpenLiveWriter.BlogClient.Clients
private static Post ConvertToGoogleBloggerPost(BlogPost post)
{
var labels = post.Categories?.Select(x => x.Name).ToList();
labels?.AddRange(post.NewCategories?.Select(x => x.Name) ?? new List<string>());
return new Post()
{
Content = post.Contents,
Labels = post.Keywords?.Split(new char[] { LabelDelimiter }, StringSplitOptions.RemoveEmptyEntries).Select(k => k.Trim()).ToList(),
Labels = labels ?? new List<string>(),
// TODO:OLW - DatePublishedOverride didn't work quite right. Either the date published override was off by several hours,
// needs to be normalized to UTC or the Blogger website thinks I'm in the wrong time zone.
Published = post.HasDatePublishedOverride ? post?.DatePublishedOverride : null,