summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2013-10-22 13:12:16 +0200
committerAndreas Mair <amair.sob@googlemail.com>2013-10-22 13:12:16 +0200
commit66c39bab76c1b4a30a80e991d07d823e2905369b (patch)
tree3cb745427b4c12ecf3195fe8c1fcb5b82ba7b046
parent48cf19b7ba6a952ba040e83c4f76b838983a62b9 (diff)
downloadvdr-plugin-extrecmenu-66c39bab76c1b4a30a80e991d07d823e2905369b.tar.gz
vdr-plugin-extrecmenu-66c39bab76c1b4a30a80e991d07d823e2905369b.tar.bz2
Add support for VDR v2.1.2+ (Submitted by TheChief @vdrportal.de)
-rw-r--r--mymenueditrecording.c20
-rw-r--r--mymenurecordings.c20
-rw-r--r--tools.c12
3 files changed, 52 insertions, 0 deletions
diff --git a/mymenueditrecording.c b/mymenueditrecording.c
index 7776717..d166d0f 100644
--- a/mymenueditrecording.c
+++ b/mymenueditrecording.c
@@ -76,7 +76,11 @@ eOSState myMenuRenameRecording::ProcessKey(eKeys Key)
if(isdir)
{
+#if APIVERSNUM > 20101
+ if(-1==asprintf(&oldname,"%s%s%s/%s",cVideoDirectory::Name(),tmppath?"/":"",dirbase?dirbase:"",dirname))
+#else
if(-1==asprintf(&oldname,"%s%s%s/%s",VideoDirectory,tmppath?"/":"",dirbase?dirbase:"",dirname))
+#endif
oldname=NULL;
}
else
@@ -84,7 +88,11 @@ eOSState myMenuRenameRecording::ProcessKey(eKeys Key)
if(oldname)
{
+#if APIVERSNUM > 20101
+ if(-1==asprintf(&newname,"%s%s%s/%s%s",cVideoDirectory::Name(),tmppath?"/":"",tmppath?tmppath:"",tmpname,isdir?"":strrchr(recording->FileName(),'/')))
+#else
if(-1==asprintf(&newname,"%s%s%s/%s%s",VideoDirectory,tmppath?"/":"",tmppath?tmppath:"",tmpname,isdir?"":strrchr(recording->FileName(),'/')))
+#endif
newname=NULL;
if(newname)
@@ -305,7 +313,11 @@ eOSState myMenuMoveRecording::MoveRec()
if(dirname)
{
+#if APIVERSNUM > 20101
+ if(-1==asprintf(&oldname,"%s%s%s/%s",cVideoDirectory::Name(),dirbase?"/":"",tmpdirbase?tmpdirbase:"",tmpdirname))
+#else
if(-1==asprintf(&oldname,"%s%s%s/%s",VideoDirectory,dirbase?"/":"",tmpdirbase?tmpdirbase:"",tmpdirname))
+#endif
oldname=NULL;
}
else
@@ -357,7 +369,11 @@ eOSState myMenuMoveRecording::MoveRec()
if(dir)
dir=ExchangeChars(dir,true);
+#if APIVERSNUM > 20101
+ if(-1==asprintf(&_newname,"%s%s%s%s",cVideoDirectory::Name(),dir?"/":"",dir?dir:"",strrchr(dirname?oldname:recording->FileName(),'/')))
+#else
if(-1==asprintf(&_newname,"%s%s%s%s",VideoDirectory,dir?"/":"",dir?dir:"",strrchr(dirname?oldname:recording->FileName(),'/')))
+#endif
_newname=NULL;
if(_newname)
@@ -424,7 +440,11 @@ eOSState myMenuMoveRecording::MoveRec()
{
if(!strncmp(oldname,rec->FileName(),strlen(oldname)))
{
+#if APIVERSNUM > 20101
+ char *_buf=ExchangeChars(strdup(oldname+strlen(cVideoDirectory::Name())+1),false);
+#else
char *_buf=ExchangeChars(strdup(oldname+strlen(VideoDirectory)+1),false);
+#endif
if(strcmp(rec->Name(),_buf))
{
diff --git a/mymenurecordings.c b/mymenurecordings.c
index cd3d91f..ac7f333 100644
--- a/mymenurecordings.c
+++ b/mymenurecordings.c
@@ -607,7 +607,11 @@ int myMenuRecordings::FreeMB()
int freediskspace=0;
if(mysetup.FileSystemFreeMB)
{
+#if APIVERSNUM > 20101
+ string path=cVideoDirectory::Name();
+#else
string path=VideoDirectory;
+#endif
path+="/";
char *tmpbase=base?ExchangeChars(strdup(base),true):NULL;
if(tmpbase)
@@ -660,7 +664,11 @@ int myMenuRecordings::FreeMB()
}
else
{
+#if APIVERSNUM > 20101
+ cVideoDirectory::VideoDiskSpace(&freediskspace);
+#else
VideoDiskSpace(&freediskspace);
+#endif
}
lastFreeMB=freediskspace;
lastDiskSpaceCheck=time(NULL);
@@ -786,7 +794,11 @@ void myMenuRecordings::Set(bool Refresh)
for(cRecording *recording=Recordings.First();recording;recording=Recordings.Next(recording))
list->Add(new myRecListItem(recording));
// sort my recordings list
+#if APIVERSNUM > 20101
+ string path=cVideoDirectory::Name();
+#else
string path=VideoDirectory;
+#endif
path+="/";
if(base)
path+=base;
@@ -1266,7 +1278,11 @@ eOSState myMenuRecordings::Commands(eKeys Key)
{
char *strBase=base?ExchangeChars(strdup(base), true):NULL;
char *strName=ExchangeChars(strdup(item->Name()), true);
+#if APIVERSNUM > 20101
+ if(-1==asprintf(&parameter,"\"%s/%s/%s\"",cVideoDirectory::Name(),strBase?strBase:"", strName))
+#else
if(-1==asprintf(&parameter,"\"%s/%s/%s\"",VideoDirectory,strBase?strBase:"", strName))
+#endif
parameter=NULL;
free(strBase);
free(strName);
@@ -1290,7 +1306,11 @@ eOSState myMenuRecordings::Commands(eKeys Key)
// change sorting
eOSState myMenuRecordings::ChangeSorting()
{
+#if APIVERSNUM > 20101
+ string path=cVideoDirectory::Name();
+#else
string path=VideoDirectory;
+#endif
path+="/";
if(base)
path+=base;
diff --git a/tools.c b/tools.c
index f7bea68..ea6e8e2 100644
--- a/tools.c
+++ b/tools.c
@@ -152,7 +152,11 @@ bool MoveRename(const char *OldName,const char *NewName,cRecording *Recording,bo
{
if(!strncmp(OldName,item->recording->FileName(),strlen(OldName)))
{
+#if APIVERSNUM > 20101
+ buf=strdup(OldName+strlen(cVideoDirectory::Name())+1);
+#else
buf=strdup(OldName+strlen(VideoDirectory)+1);
+#endif
if(buf)
{
buf=ExchangeChars(buf,false);
@@ -244,7 +248,11 @@ char *myRecListItem::SortName(void) const
char **sb=SortByName?&sortBufferName:&sortBufferTime;
if(!*sb)
{
+#if APIVERSNUM > 20101
+ char *s=StripEpisodeName(strdup(recording->FileName()+strlen(cVideoDirectory::Name())));
+#else
char *s=StripEpisodeName(strdup(recording->FileName()+strlen(VideoDirectory)));
+#endif
strreplace(s,'/',mysetup.DescendSorting ? '1' : '0'); // some locales ignore '/' when sorting
int l=strxfrm(NULL,s,0)+1;
*sb=MALLOC(char,l);
@@ -708,7 +716,11 @@ bool WorkerThread::Move(string From,string To)
isyslog("[extrecmenu] moving canceled");
+#if APIVERSNUM > 20101
+ cVideoDirectory::RemoveVideoFile(To.c_str());
+#else
RemoveVideoFile(To.c_str());
+#endif
return true;
}