Mailing List Archive

Mythweb tweak - show disk space in GB?
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.

Thanks,
Richard
Re: Mythweb tweak - show disk space in GB? [ In reply to ]
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.

Ian.

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythweb tweak - show disk space in GB? [ In reply to ]
On Sun, Nov 11, 2018 at 3:01 AM Ian Campbell <ijc@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"...

Thanks,
Richard
Re: Mythweb tweak - show disk space in GB? [ In reply to ]
On Sun, 2018-11-11 at 21:53 -0600, Richard Shaw wrote:
> On Sun, Nov 11, 2018 at 3:01 AM Ian Campbell <ijc@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.

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythweb tweak - show disk space in GB? [ In reply to ]
You could put a rule around it to scale the value to MB, GB, TB, or PB (or
higher) to keep the value within the 1 to 999 range and display to three
significant digits.

That will adapt to everybody's setup for a few years.



On Mon, 12 Nov 2018, 6:41 PM Ian Campbell <ijc@hellion.org.uk wrote:

> On Sun, 2018-11-11 at 21:53 -0600, Richard Shaw wrote:
> > On Sun, Nov 11, 2018 at 3:01 AM Ian Campbell <ijc@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.
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Mythweb tweak - show disk space in GB? [ In reply to ]
On Mon, Nov 12, 2018 at 4:42 AM TerribleTadpole <terribletadpole@gmail.com>
wrote:

> You could put a rule around it to scale the value to MB, GB, TB, or PB (or
> higher) to keep the value within the 1 to 999 range and display to three
> significant digits.
>
> That will adapt to everybody's setup for a few years.
>

I don't disagree and thought about that, but that's beyond my C/C++
ability. As Ian said, I'm just looking for a minimal change.

Thanks,
Richard