[mythtv] Mythweb tweak - show disk space in GB?

Ian Campbell ijc at hellion.org.uk
Mon Nov 12 07:41:09 UTC 2018


On Sun, 2018-11-11 at 21:53 -0600, Richard Shaw wrote:
> On Sun, Nov 11, 2018 at 3:01 AM Ian Campbell <ijc at hellion.org.uk>
> wrote:
> > On Sat, 2018-11-10 at 12:45 -0600, Richard Shaw wrote:
> > > I'm not good with perl/php otherwise I would give it a try, but
> > since
> > > Mythweb is not going away in V30, what would it take to change
> > the
> > > backend status from MB to GB... With HDTV and modern disks I
> > don't
> > > think it make sense to report MB anymore and it's difficult to
> > read
> > > when I have a 3TB main drive and a dedicated 2TB drive for
> > > recordings.
> > 
> > I think the code you want is actually in
> > mythtv/programs/mythbackend/httpstatus.cpp and is just proxied by
> > mythweb so lack of Perl/php shouldn't be a barrier.
> 
> A bit closer... I found the bit shifts ">>10" and changed them to
> ">>20" for GB but still need to find where to change "MB" to "GB"...

It's a bit further down the same file:

	int nUsed    = g.attribute("used" , "0" ).toInt();

	...

	os << "            <li>Space Used: ";
	sRep = c.toString(nUsed) + " MB";
	os << sRep << "</li>\r\n";

If it were me to avoid them getting out of sync I would move the >>10
and the naming of the units next to each other, by making the
attributed and nUsed and friends use bytes as the units, and doing the
shift in the latter bit of code right where the "MB" (or "GB") was
appended, but maybe that's just me and perhaps you are looking for the
smallest change to make.

Ian.



More information about the mythtv-dev mailing list