Added small atom item date fix

This commit is contained in:
Max 2023-06-14 20:29:21 +02:00
parent 2e619eb48a
commit 1785833132
5 changed files with 11 additions and 7 deletions

View File

@ -107,12 +107,12 @@ namespace SharpRss.Services
if (newsCategory != null)
{
await AddSubscriptionAsync("https://www.nu.nl/rss/Algemeen", newsCategory);
await AddSubscriptionAsync("https://www.ad.nl/home/rss.xml", newsCategory);
await AddSubscriptionAsync("https://www.nasa.gov/rss/dyn/breaking_news.rss", newsCategory);
await AddSubscriptionAsync("http://news.google.com/?output=atom", newsCategory);
await AddSubscriptionAsync("https://www.ad.nl/home/rss.xml", newsCategory);
}
}*/
CategoryModel? techCategory = await CreateCategoryAsync(new CategoryModel() { Name = "Tech" });
/*CategoryModel? techCategory = await CreateCategoryAsync(new CategoryModel() { Name = "Tech" });
if (techCategory != null)
{
await AddSubscriptionAsync("https://itsfoss.com/feed", techCategory);

View File

@ -114,8 +114,8 @@ namespace SharpRss
Title = entry.Title?.Content ?? string.Empty,
Description = entry.Summary?.Content ?? string.Empty,
Link = entry.Id?.Uri.ToString() ?? string.Empty,
LastUpdated = entry.UpdatedOn is not { Ticks: <= 0 } ? new DateTimeOffset(entry.UpdatedOn) : DateTimeOffset.MinValue,
PublishingDate = entry.PublishedOn is not { Ticks: <= 0 } ? new DateTimeOffset(entry.PublishedOn) : DateTimeOffset.MinValue,
LastUpdated = entry.UpdatedOn is { Ticks: > 0 } ? new DateTimeOffset(entry.UpdatedOn) : DateTimeOffset.Now,
PublishingDate = entry.PublishedOn is { Ticks: > 0 } ? new DateTimeOffset(entry.PublishedOn) : entry.UpdatedOn,
Authors = entry.Authors?.Select(auth => auth.Name).ToArray() ?? Array.Empty<string>(),
Categories = entry.Categories?.Select(cat => cat.Label).ToArray() ?? Array.Empty<string>(),
Content = entry.Content?.Content ?? string.Empty

View File

@ -39,8 +39,9 @@ namespace WebSharpRSS
if (_configuration != null) return;
_configuration = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File(new JsonFormatter(), Caretaker.Settings["Paths"].GetString("LogPath"), rollingInterval: RollingInterval.Day)
.MinimumLevel.Verbose(); // ONLY FOR DEBUGGING!!!
.WriteTo.File(new JsonFormatter(), Caretaker.Settings["Paths"].GetString("LogPath"),
rollingInterval: RollingInterval.Day);
/*.MinimumLevel.Verbose(); // ONLY FOR DEBUGGING!!!*/
Log.Logger = _configuration.CreateLogger();
}

View File

@ -44,6 +44,9 @@
<_ContentIncludedByDefault Remove="logs\log_20230602.json" />
<_ContentIncludedByDefault Remove="logs\log_20230603.json" />
<_ContentIncludedByDefault Remove="logs\log_20230604.json" />
<_ContentIncludedByDefault Remove="logs\log_20230605.json" />
<_ContentIncludedByDefault Remove="logs\log_20230610.json" />
<_ContentIncludedByDefault Remove="logs\log_20230611.json" />
</ItemGroup>
</Project>

Binary file not shown.