Ticket #7783: httpstatus.3.patch

File httpstatus.3.patch, 2.7 KB (added by beirdo, 10 years ago)

updated to svn 25410

  • mythtv/libs/libmythtv/cardutil.cpp

    diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp
    index 2c9ca74..c122f7f 100644
    a b QString CardUtil::GetDeviceLabel(const QString &cardtype, 
    17341734    return QString("[ %1 : %2 ]").arg(cardtype).arg(videodevice);
    17351735}
    17361736
     1737QString CardUtil::GetDeviceLabel(uint cardid)
     1738{
     1739    QString devlabel;
     1740    MSqlQuery query(MSqlQuery::InitCon());
     1741    query.prepare("SELECT cardtype, videodevice "
     1742                  "FROM capturecard WHERE cardid = :CARDID "
     1743                  "ORDER BY cardid");
     1744    query.bindValue(":CARDID", cardid);
     1745
     1746    if (query.exec() && query.next())
     1747    {
     1748        return( GetDeviceLabel( query.value(0).toString(),
     1749                                query.value(1).toString()) );
     1750    }
     1751
     1752    return( "[ UNKNOWN ]" );
     1753}
     1754
    17371755void CardUtil::GetCardInputs(
    17381756    uint                cardid,
    17391757    const QString      &device,
  • mythtv/libs/libmythtv/cardutil.h

    diff --git a/mythtv/libs/libmythtv/cardutil.h b/mythtv/libs/libmythtv/cardutil.h
    index 3cb636e..8bbfcbd 100644
    a b class MPUBLIC CardUtil 
    226226
    227227    static QString      GetDeviceLabel(const QString &cardtype,
    228228                                       const QString &videodevice);
     229    static QString      GetDeviceLabel(uint cardid);
    229230
    230231    static QString      ProbeSubTypeName(uint cardid);
    231232
  • mythtv/programs/mythbackend/httpstatus.cpp

    diff --git a/mythtv/programs/mythbackend/httpstatus.cpp b/mythtv/programs/mythbackend/httpstatus.cpp
    index 1b37d2c..97803f1 100644
    a b  
    3535#include "encoderlink.h"
    3636#include "scheduler.h"
    3737#include "mainserver.h"
     38#include "cardutil.h"
    3839
    3940/////////////////////////////////////////////////////////////////////////////
    4041//
    void HttpStatus::FillStatusXML( QDomDocument *pDoc ) 
    200201            else
    201202                encoder.setAttribute("hostname", elink->GetHostName());
    202203
     204            encoder.setAttribute("devlabel",
     205                          CardUtil::GetDeviceLabel(elink->GetCardID()) );
     206
    203207            if (elink->IsConnected())
    204208                numencoders++;
    205209
    int HttpStatus::PrintEncoderStatus( QTextStream &os, QDomElement encoders ) 
    708712
    709713                bool bIsLowOnFreeSpace=e.attribute( "lowOnFreeSpace", "0").toInt();
    710714
    711                 os << "    Encoder " << sCardId << " is " << sIsLocal
    712                    << " on " << sHostName;
     715                QString sDevlabel = e.attribute( "devlabel", "[ UNKNOWN ]");
     716
     717                os << "    Encoder " << sCardId << " " << sDevlabel
     718                   << " is " << sIsLocal << " on " << sHostName;
    713719
    714720                if ((sIsLocal == "remote") && !bConnected)
    715721                {