Rework database loading/migration

This commit is contained in:
2023-04-06 17:20:38 -04:00
parent b5f570688d
commit 6514f23329
21 changed files with 561 additions and 569 deletions

View File

@@ -72,8 +72,8 @@ namespace FeedCenter
public string Link { get; set; }
public string Description { get; set; }
public DateTimeOffset LastChecked { get; set; }
public int CheckInterval { get; set; }
public bool Enabled { get; set; }
public int CheckInterval { get; set; } = 60;
public bool Enabled { get; set; } = true;
public bool Authenticate { get; set; }
public string Username { get; set; }
public string Password { get; set; }
@@ -164,7 +164,7 @@ namespace FeedCenter
}
// If the feed was successfully read and we have no last update timestamp - set the last update timestamp to now
if (result == FeedReadResult.Success && LastUpdated == Extensions.SqlDateTimeZero.Value)
if (result == FeedReadResult.Success && LastUpdated == default)
LastUpdated = DateTimeOffset.Now;
Log.Logger.Information("Done reading feed: {0}", result);
@@ -172,11 +172,6 @@ namespace FeedCenter
return result;
}
public async Task<FeedReadResult> ReadAsync(FeedCenterEntities database, bool forceRead = false)
{
return await Task.Run(() => Read(database, forceRead));
}
public Tuple<FeedType, string> DetectFeedType()
{
var retrieveResult = RetrieveFeed();