Skip to content

Commit

Permalink
Only offer schedulable inputs as preferred in ScheduleEditor.
Browse files Browse the repository at this point in the history
  • Loading branch information
gigem committed Jul 14, 2016
1 parent 8b2d79d commit ce0d14e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -12,7 +12,7 @@
/// Update this whenever the plug-in ABI changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods in exported headers.
#define MYTH_BINARY_VERSION "29.20160710-1"
#define MYTH_BINARY_VERSION "29.20160714-1"

/** \brief Increment this whenever the MythTV network protocol changes.
* Note that the token currently cannot contain spaces.
Expand Down
27 changes: 24 additions & 3 deletions mythtv/libs/libmythtv/cardutil.cpp
Expand Up @@ -2030,6 +2030,28 @@ vector<uint> CardUtil::GetInputList(void)
return list;
}

vector<uint> CardUtil::GetSchedInputList(void)
{
vector<uint> list;

MSqlQuery query(MSqlQuery::InitCon());
query.prepare(
"SELECT DISTINCT cardid "
"FROM capturecard "
"WHERE schedorder <> 0 "
"ORDER BY schedorder, cardid");

if (!query.exec())
MythDB::DBError("CardUtil::GetSchedInputList()", query);
else
{
while (query.next())
list.push_back(query.value(0).toUInt());
}

return list;
}

vector<uint> CardUtil::GetLiveTVInputList(void)
{
vector<uint> list;
Expand All @@ -2039,10 +2061,10 @@ vector<uint> CardUtil::GetLiveTVInputList(void)
"SELECT DISTINCT cardid "
"FROM capturecard "
"WHERE livetvorder <> 0 "
"ORDER BY livetvorder");
"ORDER BY livetvorder, cardid");

if (!query.exec())
MythDB::DBError("CardUtil::GetInputList()", query);
MythDB::DBError("CardUtil::GetLiveTVInputList()", query);
else
{
while (query.next())
Expand All @@ -2052,7 +2074,6 @@ vector<uint> CardUtil::GetLiveTVInputList(void)
return list;
}


QString CardUtil::GetDeviceName(dvb_dev_type_t type, const QString &device)
{
QString devname = QString(device);
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/cardutil.h
Expand Up @@ -241,6 +241,7 @@ class MTV_PUBLIC CardUtil
static bool DeleteCard(uint inputid);
static bool DeleteAllCards(void);
static vector<uint> GetInputList(void);
static vector<uint> GetSchedInputList(void);
static vector<uint> GetLiveTVInputList(void);

/// Convenience function for GetInputIDs()
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/scheduleeditor.cpp
Expand Up @@ -2095,7 +2095,7 @@ void SchedOptMixin::Load(void)
QObject::tr("Use any available input"),
qVariantFromValue(0));

vector<uint> inputids = CardUtil::GetInputList();
vector<uint> inputids = CardUtil::GetSchedInputList();
for (uint i = 0; i < inputids.size(); ++i)
{
new MythUIButtonListItem(m_inputList,
Expand Down

0 comments on commit ce0d14e

Please sign in to comment.