Support Syndication Support Rss Optional Elements#26612
Support Syndication Support Rss Optional Elements#26612mconnew merged 10 commits intodotnet:masterfrom
Conversation
| } | ||
| else | ||
| { | ||
| return null; |
There was a problem hiding this comment.
Nit: This could be simplified, e.g.:
using (XmlReader reader = timeToLiveElement.GetReader())
{
string value = reader.ReadElementString();
if (int.TryParse(value, out int timeToLive) && timeToLive >= 0)
{
return TimeSpan.FromMinutes(timeToLive);
}
return null;
}| { | ||
| if (value.HasValue && (value.Value.Milliseconds != 0 || value.Value.Seconds != 0 || value.Value.TotalMinutes < 0)) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(value), value.Value, SR.InvalidTimeToLiveValue); |
There was a problem hiding this comment.
We might use nameof(TimeToLive) here
| } | ||
|
|
||
| private SyndicationLink ReadAlternateLink(XmlReader reader, Uri baseUri) | ||
| internal static SyndicationLink ReadAlternateLink(XmlReader reader, Uri baseUri, Func<string, UriKind, string, string, Uri> uriParser, bool preserveAttributeExtensions) |
There was a problem hiding this comment.
Do we always pass UriParser as uriParser to ReadAlternateLink?
There was a problem hiding this comment.
No we don't. We have one case where we are calling it from a context where we don't have a user provided parser so we pass in the default parser.
| throw new FormatException(string.Format(SR.InvalidSkipHourValue, value)); | ||
| } | ||
|
|
||
| skipHours.Add(hour); |
There was a problem hiding this comment.
Do we need to consider the duplicated items? Same as skipDays below.
|
@dotnet-bot test NETFX x86 Release Build |
Ref #25608.
8d36aaa to
1c4b8d9
Compare
|
Failures on OpenSuse.423, Centos.74 and Ubuntu.1804. |
Implementation and tests for supporting some RSS elements which we didn't previously support. This adds support for the following RSS feed elements:
<docs>Link to Uri explaining feed schema - Documentation<skipDays>List of days for an aggregator to skip fetching - SkipDays<skipHours>List of hours for an aggregator to not fetch the feed - SkipHours<textInput>Describes an input field and url to submit some data to - TextInput<ttl>How long the feed should be considered valid in a cache - TimeToLiveThe TextInput is of type
SyndicationTextInputwhich contains 4 fields matching the RSS spec. See here for details.The API review for this change is #25718 and has been approved. This PR replaces #25625
Fixes #25718