fix: rename 'corrupt' label for understandability (#2605)

Fixes #154. The current 'corrupt' label can confuse users to think that
there is corrupt data on the disk. The phrasing has been changed:

- Downloaded: 1.91 GB
- Corrupt DL: 22.02 MB

+ Downloaded: 1.91 GB (+22.02 MB discarded after failed checksum)
This commit is contained in:
Charles Kerr 2022-02-11 01:15:10 -06:00 committed by GitHub
parent 6383e2ff5f
commit a87be3762f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View File

@ -926,7 +926,7 @@ void DetailsDialog::Impl::refreshInfo(std::vector<tr_torrent*> const& torrents)
if (f != 0)
{
str = gtr_sprintf(_("%1$s (+%2$s corrupt)"), dbuf, fbuf);
str = gtr_sprintf(_("%1$s (+%2$s discarded after failed checksum)"), dbuf, fbuf);
}
else
{

View File

@ -556,7 +556,7 @@ void DetailsDialog::refreshUI()
if (f != 0)
{
string = tr("%1 (%2 corrupt)").arg(dstr).arg(fstr);
string = tr("%1 (+%2 discarded after failed checksum)").arg(dstr).arg(fstr);
}
else
{

View File

@ -1030,16 +1030,21 @@ static void printDetails(tr_variant* top)
if (tr_variantDictFindInt(t, TR_KEY_downloadedEver, &i) && tr_variantDictFindInt(t, TR_KEY_uploadedEver, &j))
{
printf(" Downloaded: %s\n", strlsize(i).c_str());
if (auto corrupt = int64_t{}; tr_variantDictFindInt(t, TR_KEY_corruptEver, &corrupt) && corrupt != 0)
{
printf(
" Downloaded: %s (+%s discarded after failed checksum)\n",
strlsize(i).c_str(),
strlsize(corrupt).c_str());
}
else
{
printf(" Downloaded: %s\n", strlsize(i).c_str());
}
printf(" Uploaded: %s\n", strlsize(j).c_str());
printf(" Ratio: %s\n", strlratio(j, i).c_str());
}
if (tr_variantDictFindInt(t, TR_KEY_corruptEver, &i))
{
printf(" Corrupt DL: %s\n", strlsize(i).c_str());
}
if (tr_variantDictFindStrView(t, TR_KEY_errorString, &sv) && !std::empty(sv) &&
tr_variantDictFindInt(t, TR_KEY_error, &i) && i != 0)
{

File diff suppressed because one or more lines are too long

View File

@ -340,7 +340,9 @@ export class Inspector extends EventTarget {
(accumulator, t) => accumulator + t.getFailedEver(),
0
);
string = f ? `${fmt.size(d)} (${fmt.size(f)} corrupt)` : fmt.size(d);
string = f
? `${fmt.size(d)} (+${fmt.size(f)} discarded after failed checksum)`
: fmt.size(d);
}
setTextContent(e.info.downloaded, string);