Code cleanup

This commit is contained in:
2023-04-07 22:24:52 -04:00
parent 96d327270f
commit 64d0f770ca
12 changed files with 58 additions and 72 deletions

View File

@@ -1,7 +1,8 @@
using ChrisKaczor.ApplicationUpdate;
using FeedCenter.Data;
using FeedCenter.FeedParsers;
using FeedCenter.Properties;
using FeedCenter.Xml;
using JetBrains.Annotations;
using Realms;
using Serilog;
using System;
@@ -14,8 +15,6 @@ using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using FeedCenter.Xml;
using Resources = FeedCenter.Properties.Resources;
namespace FeedCenter
@@ -36,12 +35,6 @@ namespace FeedCenter
Atom
}
public enum FeedItemComparison : byte
{
Default,
Title
}
public enum FeedReadResult
{
Success,
@@ -77,7 +70,6 @@ namespace FeedCenter
public bool Authenticate { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Domain { get; set; }
private string LastReadResultRaw { get; set; }
@@ -89,14 +81,6 @@ namespace FeedCenter
public DateTimeOffset LastUpdated { get; set; }
private string ItemComparisonRaw { get; set; }
public FeedItemComparison ItemComparison
{
get => Enum.TryParse(ItemComparisonRaw, out FeedItemComparison result) ? result : FeedItemComparison.Default;
set => ItemComparisonRaw = value.ToString();
}
[MapTo("CategoryID")]
public Guid CategoryId { get; set; }
@@ -110,6 +94,7 @@ namespace FeedCenter
public Category Category { get; set; }
[UsedImplicitly]
public IList<FeedItem> Items { get; }
// ReSharper disable once UnusedMember.Global
@@ -217,6 +202,9 @@ namespace FeedCenter
// Get the feed text
var feedText = textReader.ReadToEnd();
if (string.IsNullOrEmpty(feedText))
return Tuple.Create(FeedReadResult.NoResponse, string.Empty);
// Get rid of any leading and trailing whitespace
feedText = feedText.Trim();