Permalink
Browse files

Services: Allow Dvr::GetTitleList() to be filtered by Recording Group

  • Loading branch information...
1 parent 99d0893 commit 725a72c392b871dcb7812e0bd67d827fd8e73aff @stuartm stuartm committed Nov 14, 2013
View
2 mythtv/html/tv/recordings.qsp
@@ -116,7 +116,7 @@ import "/tv/js/constants.js"
<select id="listDisplayGroup" name="DisplayGroup" onChange="submitForm(this.form)">
<%
- var displayGroupList = dvr.GetTitleList();
+ var displayGroupList = dvr.GetTitleList(recGroup);
%>
<option value="" <%if (displayGroup == displayGroupList[grpIdx]) {%>selected<%}%>>All</option>
<%
View
4 mythtv/libs/libmythservicecontracts/services/dvrServices.h
@@ -40,7 +40,7 @@
class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
{
Q_OBJECT
- Q_CLASSINFO( "version" , "2.2" );
+ Q_CLASSINFO( "version" , "2.3" );
Q_CLASSINFO( "RemoveRecordedItem_Method", "POST" )
Q_CLASSINFO( "AddRecordSchedule_Method", "POST" )
Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" )
@@ -100,7 +100,7 @@ class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
virtual QStringList GetRecGroupList ( ) = 0;
- virtual QStringList GetTitleList ( ) = 0;
+ virtual QStringList GetTitleList ( const QString &RecGroup ) = 0;
virtual DTC::TitleInfoList* GetTitleInfoList ( ) = 0;
View
15 mythtv/programs/mythbackend/services/dvr.cpp
@@ -361,14 +361,23 @@ QStringList Dvr::GetRecGroupList()
//
/////////////////////////////////////////////////////////////////////////////
-QStringList Dvr::GetTitleList()
+// TODO: Needs converting to use RecGroupID
+QStringList Dvr::GetTitleList(const QString& RecGroup)
{
MSqlQuery query(MSqlQuery::InitCon());
- QString querystr = QString("SELECT DISTINCT title FROM recorded");
+ QString querystr = "SELECT DISTINCT title FROM recorded";
+
+ if (!RecGroup.isEmpty())
+ querystr += " WHERE recgroup = :RECGROUP";
+
+ querystr += " ORDER BY title";
query.prepare(querystr);
+ if (!RecGroup.isEmpty())
+ query.bindValue(":RECGROUP", RecGroup);
+
QStringList result;
if (!query.exec())
{
@@ -379,8 +388,6 @@ QStringList Dvr::GetTitleList()
while (query.next())
result << query.value(0).toString();
- result.sort();
-
return result;
}
View
7 mythtv/programs/mythbackend/services/dvr.h
@@ -78,7 +78,7 @@ class Dvr : public DvrServices
QStringList GetRecGroupList ( );
- QStringList GetTitleList ( );
+ QStringList GetTitleList ( const QString &RecGroup );
DTC::TitleInfoList* GetTitleInfoList ( );
@@ -290,7 +290,10 @@ class ScriptableDvr : public QObject
QStringList GetRecGroupList () { return m_obj.GetRecGroupList(); }
- QStringList GetTitleList () { return m_obj.GetTitleList(); }
+ QStringList GetTitleList ( const QString &RecGroup )
+ {
+ return m_obj.GetTitleList( RecGroup );
+ }
QObject* GetTitleInfoList () { return m_obj.GetTitleInfoList(); }

0 comments on commit 725a72c

Please sign in to comment.