Fix adding feeds when offline or paused

This commit is contained in:
relikd
2019-08-14 16:47:34 +02:00
parent e6f4d05213
commit 9e7eda692b
14 changed files with 73 additions and 64 deletions

View File

@@ -26,6 +26,14 @@
@implementation FeedMeta (Ext)
/// Create new instance with default @c refresh interval and set @c scheduled to distant past.
+ (instancetype)newMetaInContext:(NSManagedObjectContext*)moc {
FeedMeta *meta = [[FeedMeta alloc] initWithEntity:FeedMeta.entity insertIntoManagedObjectContext:moc];
meta.refresh = kDefaultFeedRefreshInterval;
meta.scheduled = [NSDate distantPast]; // will cause update to refresh as soon as possible
return meta;
}
#pragma mark - HTTP response
/// Increment @c errorCount and set new @c scheduled date (2^N minutes, max. 5.7 days).