mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
Show old VDR PES recordings in HTTP menu only if PES mode is selected
This commit is contained in:
parent
e83c9d92aa
commit
58f0348578
@ -468,7 +468,7 @@ cMenuList* cConnectionHTTP::MenuListFromString(const std::string& Path, const st
|
|||||||
(Filebase.empty() && Fileext.empty())) {
|
(Filebase.empty() && Fileext.empty())) {
|
||||||
iterator = new cListAll();
|
iterator = new cListAll();
|
||||||
} else if (Filebase.compare("recordings") == 0) {
|
} else if (Filebase.compare("recordings") == 0) {
|
||||||
iterator = new cRecordingsIterator();
|
iterator = new cRecordingsIterator(m_StreamType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iterator) {
|
if (iterator) {
|
||||||
|
@ -6,12 +6,25 @@
|
|||||||
#include "server/menuHTTP.h"
|
#include "server/menuHTTP.h"
|
||||||
|
|
||||||
//**************************** cRecordingIterator **************
|
//**************************** cRecordingIterator **************
|
||||||
cRecordingsIterator::cRecordingsIterator(): RecordingsLock(&Recordings)
|
cRecordingsIterator::cRecordingsIterator(eStreamType StreamType): RecordingsLock(&Recordings)
|
||||||
{
|
{
|
||||||
first = Recordings.First();
|
streamType = StreamType;
|
||||||
|
first = NextSuitable(Recordings.First());
|
||||||
current = NULL;
|
current = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cRecording* cRecordingsIterator::NextSuitable(const cRecording *Recording)
|
||||||
|
{
|
||||||
|
while (Recording)
|
||||||
|
{
|
||||||
|
bool isPes = Recording->IsPesRecording();
|
||||||
|
if (!isPes || (isPes && streamType == stPES))
|
||||||
|
break;
|
||||||
|
Recording = Recordings.Next(Recording);
|
||||||
|
}
|
||||||
|
return Recording;
|
||||||
|
}
|
||||||
|
|
||||||
bool cRecordingsIterator::Next()
|
bool cRecordingsIterator::Next()
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
@ -20,7 +33,7 @@ bool cRecordingsIterator::Next()
|
|||||||
first = NULL;
|
first = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
current = Recordings.Next(current);
|
current = NextSuitable(Recordings.Next(current));
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,12 @@ class cItemIterator
|
|||||||
class cRecordingsIterator: public cItemIterator
|
class cRecordingsIterator: public cItemIterator
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
eStreamType streamType;
|
||||||
const cRecording *first;
|
const cRecording *first;
|
||||||
const cRecording *current;
|
const cRecording *current;
|
||||||
cThreadLock RecordingsLock;
|
cThreadLock RecordingsLock;
|
||||||
|
protected:
|
||||||
|
virtual const cRecording* NextSuitable(const cRecording *Recording);
|
||||||
public:
|
public:
|
||||||
virtual bool Next();
|
virtual bool Next();
|
||||||
virtual bool IsGroup() const { return false; }
|
virtual bool IsGroup() const { return false; }
|
||||||
@ -35,7 +38,7 @@ class cRecordingsIterator: public cItemIterator
|
|||||||
virtual const cString ItemRessource() const;
|
virtual const cString ItemRessource() const;
|
||||||
virtual const char* Alang(int i) const { return NULL; }
|
virtual const char* Alang(int i) const { return NULL; }
|
||||||
virtual const char* Dlang(int i) const { return NULL; }
|
virtual const char* Dlang(int i) const { return NULL; }
|
||||||
cRecordingsIterator();
|
cRecordingsIterator(eStreamType StreamType);
|
||||||
virtual ~cRecordingsIterator() {};
|
virtual ~cRecordingsIterator() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user