mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
when displaying the tracker/scrape last announce, factor in an error with no message
This commit is contained in:
parent
9dc679ab58
commit
9add3fe570
1 changed files with 25 additions and 9 deletions
|
@ -92,21 +92,29 @@
|
||||||
else
|
else
|
||||||
dateString = NSLocalizedString(@"N/A", "Tracker last announce");
|
dateString = NSLocalizedString(@"N/A", "Tracker last announce");
|
||||||
|
|
||||||
|
NSString * baseString;
|
||||||
if (fStat.hasAnnounced && !fStat.lastAnnounceSucceeded)
|
if (fStat.hasAnnounced && !fStat.lastAnnounceSucceeded)
|
||||||
dateString = [NSLocalizedString(@"Announce error", "Tracker last announce") stringByAppendingFormat: @": %@ - %@",
|
{
|
||||||
[NSString stringWithUTF8String: fStat.lastAnnounceResult], dateString];
|
baseString = NSLocalizedString(@"Announce error", "Tracker last announce");
|
||||||
|
NSString * errorString = [NSString stringWithUTF8String: fStat.lastAnnounceResult];
|
||||||
|
|
||||||
|
if ([errorString isEqualToString: @""])
|
||||||
|
baseString = [baseString stringByAppendingFormat: @": %@", dateString];
|
||||||
|
else
|
||||||
|
baseString = [baseString stringByAppendingFormat: @": %@ - %@", errorString, dateString];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dateString = [NSLocalizedString(@"Last Announce", "Tracker last announce") stringByAppendingFormat: @": %@", dateString];
|
baseString = [NSLocalizedString(@"Last Announce", "Tracker last announce") stringByAppendingFormat: @": %@", dateString];
|
||||||
if (fStat.hasAnnounced && fStat.lastAnnounceSucceeded)
|
if (fStat.hasAnnounced && fStat.lastAnnounceSucceeded)
|
||||||
{
|
{
|
||||||
NSString * peerString = [NSString stringWithFormat: NSLocalizedString(@"got %d peers", "Tracker last announce"),
|
NSString * peerString = [NSString stringWithFormat: NSLocalizedString(@"got %d peers", "Tracker last announce"),
|
||||||
fStat.lastAnnouncePeerCount];
|
fStat.lastAnnouncePeerCount];
|
||||||
dateString = [dateString stringByAppendingFormat: @" (%@)", peerString];
|
baseString = [baseString stringByAppendingFormat: @" (%@)", peerString];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dateString;
|
return baseString;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) nextAnnounceStatusString
|
- (NSString *) nextAnnounceStatusString
|
||||||
|
@ -151,13 +159,21 @@
|
||||||
else
|
else
|
||||||
dateString = NSLocalizedString(@"N/A", "Tracker last scrape");
|
dateString = NSLocalizedString(@"N/A", "Tracker last scrape");
|
||||||
|
|
||||||
|
NSString * baseString;
|
||||||
if (fStat.hasScraped && !fStat.lastScrapeSucceeded)
|
if (fStat.hasScraped && !fStat.lastScrapeSucceeded)
|
||||||
dateString = [NSLocalizedString(@"Scrape error", "Tracker last scrape") stringByAppendingFormat: @": %@ - %@",
|
{
|
||||||
[NSString stringWithUTF8String: fStat.lastScrapeResult], dateString];
|
baseString = NSLocalizedString(@"Scrape error", "Tracker last scrape");
|
||||||
|
NSString * errorString = [NSString stringWithUTF8String: fStat.lastScrapeResult];
|
||||||
|
|
||||||
|
if ([errorString isEqualToString: @""])
|
||||||
|
baseString = [baseString stringByAppendingFormat: @": %@", dateString];
|
||||||
|
else
|
||||||
|
baseString = [baseString stringByAppendingFormat: @": %@ - %@", errorString, dateString];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dateString = [NSLocalizedString(@"Last Scrape", "Tracker last scrape") stringByAppendingFormat: @": %@", dateString];
|
baseString = [NSLocalizedString(@"Last Scrape", "Tracker last scrape") stringByAppendingFormat: @": %@", dateString];
|
||||||
|
|
||||||
return dateString;
|
return baseString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue