Skip to content

Commit 8992b86

Browse files
committed
Fix QUERY_RECORDINGS sorting.
This was left out of the programinfo refactor in 6e17b4d . Binary version change, plugin rebuild required.
1 parent c4927c2 commit 8992b86

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

mythtv/libs/libmyth/programinfo.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4282,7 +4282,8 @@ bool LoadFromRecorded(
42824282
bool possiblyInProgressRecordingsOnly,
42834283
const QMap<QString,uint32_t> &inUseMap,
42844284
const QMap<QString,bool> &isJobRunning,
4285-
const QMap<QString, ProgramInfo*> &recMap)
4285+
const QMap<QString, ProgramInfo*> &recMap,
4286+
bool sortDescending)
42864287
{
42874288
destination.clear();
42884289

@@ -4296,6 +4297,10 @@ bool LoadFromRecorded(
42964297
if (possiblyInProgressRecordingsOnly)
42974298
thequery += "WHERE r.endtime >= NOW() AND r.starttime <= NOW() ";
42984299

4300+
thequery += "ORDER BY r.starttime ";
4301+
if (sortDescending)
4302+
thequery += "DESC ";
4303+
42994304
MSqlQuery query(MSqlQuery::InitCon());
43004305
query.prepare(thequery);
43014306

mythtv/libs/libmyth/programinfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ MPUBLIC bool LoadFromRecorded(
698698
bool possiblyInProgressRecordingsOnly,
699699
const QMap<QString,uint32_t> &inUseMap,
700700
const QMap<QString,bool> &isJobRunning,
701-
const QMap<QString, ProgramInfo*> &recMap);
701+
const QMap<QString, ProgramInfo*> &recMap,
702+
bool sortDescending = false);
702703

703704
template<typename TYPE>
704705
bool LoadFromScheduler(

mythtv/libs/libmythbase/mythversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Update this whenever the plug-in API changes.
1313
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
1414
/// libmythui class methods used by plug-ins.
15-
#define MYTH_BINARY_VERSION "0.25.20110221-1"
15+
#define MYTH_BINARY_VERSION "0.25.20110305-1"
1616

1717
/** \brief Increment this whenever the MythTV network protocol changes.
1818
*

mythtv/programs/mythbackend/mainserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ void MainServer::HandleQueryRecordings(QString type, PlaybackSock *pbs)
15601560
ProgramList destination;
15611561
LoadFromRecorded(
15621562
destination, (type == "Recording"),
1563-
inUseMap, isJobRunning, recMap);
1563+
inUseMap, isJobRunning, recMap, (type == "Delete"));
15641564

15651565
QMap<QString,ProgramInfo*>::iterator mit = recMap.begin();
15661566
for (; mit != recMap.end(); mit = recMap.erase(mit))

mythtv/programs/mythbackend/mythxml.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,8 @@ void MythXML::GetAlbumArt( HTTPRequest *pRequest )
10111011

10121012
void MythXML::GetRecorded( HTTPRequest *pRequest )
10131013
{
1014+
bool bDescending = pRequest->m_mapParams[ "Descending" ].toInt();
1015+
10141016
QMap<QString,ProgramInfo*> recMap;
10151017
if (sched)
10161018
recMap = sched->GetRecording();
@@ -1020,7 +1022,7 @@ void MythXML::GetRecorded( HTTPRequest *pRequest )
10201022

10211023
ProgramList progList;
10221024
LoadFromRecorded( progList, false,
1023-
inUseMap, isJobRunning, recMap );
1025+
inUseMap, isJobRunning, recMap, bDescending );
10241026

10251027
QMap<QString,ProgramInfo*>::iterator mit = recMap.begin();
10261028
for (; mit != recMap.end(); mit = recMap.erase(mit))

0 commit comments

Comments
 (0)