Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
#541: preserving age and size info for urls from feed
Browse files Browse the repository at this point in the history
and showing it in history of webui
  • Loading branch information
hugbug committed Jul 10, 2018
1 parent 14c5a1c commit 93ad31b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions daemon/feed/FeedCoordinator.cpp
Expand Up @@ -454,6 +454,9 @@ std::unique_ptr<NzbInfo> FeedCoordinator::CreateNzbInfo(FeedInfo* feedInfo, Feed
nzbInfo->SetDupeKey(feedItemInfo.GetDupeKey());
nzbInfo->SetDupeScore(feedItemInfo.GetDupeScore());
nzbInfo->SetDupeMode(feedItemInfo.GetDupeMode());
nzbInfo->SetSize(feedItemInfo.GetSize());
nzbInfo->SetMinTime(feedItemInfo.GetTime());
nzbInfo->SetMaxTime(feedItemInfo.GetTime());

return nzbInfo;
}
Expand Down
6 changes: 3 additions & 3 deletions webui/history.js
Expand Up @@ -179,14 +179,14 @@ var History = (new function($)
var kind = hist.Kind;
hist.status = HistoryUI.buildStatusText(hist);
hist.name = hist.Name;
hist.size = kind === 'URL' ? '' : Util.formatSizeMB(hist.FileSizeMB);
hist.size = kind === 'URL' && hist.FileSizeLo == 0 && hist.FileSizeHi == 0 ? '' : Util.formatSizeMB(hist.FileSizeMB);
hist.sizemb = hist.FileSizeMB;
hist.sizegb = hist.FileSizeMB / 1024;
hist.time = Util.formatDateTime(hist.HistoryTime + UISettings.timeZoneCorrection*60*60);
hist.category = kind !== 'DUP' ? hist.Category : '';
hist.dupe = DownloadsUI.buildDupeText(hist.DupeKey, hist.DupeScore, hist.DupeMode);
var age_sec = kind === 'NZB' ? new Date().getTime() / 1000 - (hist.MinPostTime + UISettings.timeZoneCorrection*60*60) : 0;
hist.age = kind === 'NZB' ? Util.formatAge(hist.MinPostTime + UISettings.timeZoneCorrection*60*60) : '';
var age_sec = hist.MinPostTime > 0 ? new Date().getTime() / 1000 - (hist.MinPostTime + UISettings.timeZoneCorrection*60*60) : 0;
hist.age = hist.MinPostTime > 0 ? Util.formatAge(hist.MinPostTime + UISettings.timeZoneCorrection*60*60) : '';
hist.agem = Util.round0(age_sec / 60);
hist.ageh = Util.round0(age_sec / (60*60));
hist.aged = Util.round0(age_sec / (60*60*24));
Expand Down

0 comments on commit 93ad31b

Please sign in to comment.