From 11e5ff7a792203dc30e7a0e2b1f47b9525dca08c Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Tue, 12 Apr 2011 12:34:29 +0200 Subject: - Fixed counting of hidden recordings if PIN plugin is used (Closes #421). - Optimized building list of recordings if PIN plugin is used. --- mymenurecordings.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'mymenurecordings.c') diff --git a/mymenurecordings.c b/mymenurecordings.c index 9abd4fb..890c992 100644 --- a/mymenurecordings.c +++ b/mymenurecordings.c @@ -733,30 +733,36 @@ void myMenuRecordings::Set(bool Refresh,char *_current) path+=base; list->Sort(mySortList->Find(path)); +#ifdef USE_PINPLUGIN + bool hidepinprotectedrecs=false; + cPlugin *pinplugin=cPluginManager::GetPlugin("pin"); + if(pinplugin) + hidepinprotectedrecs=pinplugin->SetupParse("hideProtectedRecordings","1"); +#endif + char *lastitemtext=NULL; myMenuRecordingsItem *lastitem=NULL; for(myRecListItem *listitem=list->First();listitem;listitem=list->Next(listitem)) { cRecording *recording=listitem->recording; - if(!base||(strstr(listitem->recording->Name(),base)==listitem->recording->Name()&&listitem->recording->Name()[strlen(base)]=='~')) + if(!base||(strstr(recording->Name(),base)==recording->Name()&&recording->Name()[strlen(base)]=='~')) { - myMenuRecordingsItem *recitem=new myMenuRecordingsItem(listitem->recording,level); + myMenuRecordingsItem *recitem=new myMenuRecordingsItem(recording,level); + if(*recitem->UniqID() && (!lastitem || strcmp(recitem->UniqID(),lastitemtext))) + { #ifdef USE_PINPLUGIN - bool hidepinprotectedrecs=false; - cPlugin *pinplugin=cPluginManager::GetPlugin("pin"); - if(pinplugin) - hidepinprotectedrecs=pinplugin->SetupParse("hideProtectedRecordings","1"); - - if((*recitem->UniqID() && ((!lastitem || strcmp(recitem->UniqID(),lastitemtext)))) && - !((cStatus::MsgReplayProtected(GetRecording(recitem),recitem->Name(),base,recitem->IsDirectory(),true)) && hidepinprotectedrecs)) -#else - if(*recitem->UniqID() && ((!lastitem || strcmp(recitem->UniqID(),lastitemtext)))) + if(!(hidepinprotectedrecs && cStatus::MsgReplayProtected(recording,recitem->Name(),base,recitem->IsDirectory(),true))) + { +#endif + Add(recitem); + lastitem=recitem; + free(lastitemtext); + lastitemtext=strdup(lastitem->UniqID()); +#ifdef USE_PINPLUGIN + } + else + lastitem=NULL; #endif - { - Add(recitem); - lastitem=recitem; - free(lastitemtext); - lastitemtext=strdup(lastitem->UniqID()); } else delete recitem; -- cgit v1.2.3