1
0
Fork 0
mirror of https://github.com/sbrl/PolyFeed.git synced 2024-06-02 06:43:00 +00:00

Make author stuff optional

This commit is contained in:
Starbeamrainbowlabs 2019-08-05 01:05:49 +01:00
parent 54ab735562
commit 78fc03c7c6
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -123,6 +123,8 @@ namespace PolyFeed
else // It requires one, apparently
nextItem.LastUpdated = DateTimeOffset.Now;
if (source.Entries.AuthorName != null) {
SyndicationPerson author = new SyndicationPerson(
nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorName).Trim(),
""
@ -131,6 +133,10 @@ namespace PolyFeed
author.Uri = nextNode.QuerySelectorAttributeOrText(source.Entries.AuthorUrl);
nextItem.AddContributor(author);
}
else
nextItem.AddContributor(new SyndicationPerson("Unknown", ""));
await feed.Write(nextItem);