Ticket #6582: mythtv-6582-skip_special_storage_groups_in_status_page.2.patch

File mythtv-6582-skip_special_storage_groups_in_status_page.2.patch, 1.4 KB (added by sphery, 16 years ago)

Updated patch. Works for systems with LiveTV Storage Group defined.

  • programs/mythbackend/backendutil.cpp

    old new  
    2121#include "util.h"
    2222#include "decodeencode.h"
    2323#include "compat.h"
     24#include "storagegroup.h"
    2425
    2526static QMap<QString, int> fsID_cache;
    2627static QMutex cache_lock;
     
    7374    QString driveKey;
    7475    QString localStr = "1";
    7576    struct statfs statbuf;
     77    QStringList groups(StorageGroup::kSpecialGroups);
     78    groups.removeAll("LiveTV");
     79    QString specialGroups = groups.join("', '");
     80    QString sql = QString("SELECT MIN(id),dirname "
     81                            "FROM storagegroup "
     82                           "WHERE hostname = :HOSTNAME "
     83                             "AND groupname NOT IN ( '%1' ) "
     84                           "GROUP BY dirname;").arg(specialGroups);
    7685    MSqlQuery query(MSqlQuery::InitCon());
    77     query.prepare("SELECT MIN(id),dirname "
    78                   "FROM storagegroup "
    79                   "WHERE hostname = :HOSTNAME "
    80                     "AND groupname <> :BACKUPGRP "
    81                   "GROUP BY dirname;");
     86    query.prepare(sql);
    8287    query.bindValue(":HOSTNAME", gContext->GetHostName());
    83     query.bindValue(":BACKUPGRP", "DB Backups");
    8488
    8589    if (query.exec() && query.isActive())
    8690    {