Refresh interval string localizations
This commit is contained in:
@@ -48,5 +48,4 @@ typedef NS_ENUM(int16_t, FeedGroupType) {
|
||||
- (BOOL)iterateSorted:(BOOL)ordered overDescendantFeeds:(void(^)(Feed *feed, BOOL* cancel))block;
|
||||
// Printing
|
||||
- (NSString*)readableDescription;
|
||||
- (nonnull NSString*)refreshString;
|
||||
@end
|
||||
|
||||
@@ -141,22 +141,10 @@
|
||||
/// @return Simplified description of the feed object.
|
||||
- (NSString*)readableDescription {
|
||||
switch (self.type) {
|
||||
case GROUP: return [NSString stringWithFormat:@"%@:", self.name];
|
||||
case FEED: return [NSString stringWithFormat:@"%@ (%@)", self.name, self.feed.meta.url];
|
||||
case SEPARATOR: return @"-------------";
|
||||
case GROUP: return [NSString stringWithFormat:@"%@", self.name];
|
||||
case FEED:
|
||||
return [NSString stringWithFormat:@"%@ (%@) - %@", self.name, self.feed.meta.url, [self refreshString]];
|
||||
}
|
||||
}
|
||||
|
||||
/// @return Formatted string for update interval ( e.g., @c 30m or @c 12h )
|
||||
- (nonnull NSString*)refreshString {
|
||||
if (self.type == FEED) {
|
||||
int32_t refresh = self.feed.meta.refresh;
|
||||
if (refresh <= 0)
|
||||
return @"∞"; // ∞ ƒ Ø
|
||||
return [NSDate stringForInterval:refresh rounded:NO];
|
||||
}
|
||||
return @"";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
if (self.errorCount < 0)
|
||||
self.errorCount = 0;
|
||||
int16_t n = self.errorCount + 1; // always increment errorCount (can be used to indicate bad feeds)
|
||||
// TODO: remove logging
|
||||
#ifdef DEBUG
|
||||
NSLog(@"ERROR: Feed download failed: %@ (errorCount: %d)", self.url, n);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user