mirror of
https://github.com/sbrl/PolyFeed.git
synced 2024-11-14 05:13:00 +00:00
Make author stuff optional
This commit is contained in:
parent
54ab735562
commit
78fc03c7c6
1 changed files with 13 additions and 7 deletions
|
@ -123,14 +123,20 @@ namespace PolyFeed
|
||||||
else // It requires one, apparently
|
else // It requires one, apparently
|
||||||
nextItem.LastUpdated = DateTimeOffset.Now;
|
nextItem.LastUpdated = DateTimeOffset.Now;
|
||||||
|
|
||||||
|
|
||||||
|
if (source.Entries.AuthorName != null) {
|
||||||
SyndicationPerson author = new SyndicationPerson(
|
SyndicationPerson author = new SyndicationPerson(
|
||||||
nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorName).Trim(),
|
nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorName).Trim(),
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
if(source.Entries.AuthorUrl != null)
|
if (source.Entries.AuthorUrl != null)
|
||||||
author.Uri = nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorUrl);
|
author.Uri = nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorUrl);
|
||||||
|
|
||||||
nextItem.AddContributor(author);
|
nextItem.AddContributor(author);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nextItem.AddContributor(new SyndicationPerson("Unknown", ""));
|
||||||
|
|
||||||
|
|
||||||
await feed.Write(nextItem);
|
await feed.Write(nextItem);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue