summarylogtreecommitdiffstats
path: root/upnp-vdr2.1.2compat.diff
blob: 6820010a06b86008140d7e3225a098b5bbe35164 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
index 4b835cc..cbd541b 100644
--- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
+++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
@@ -171,7 +171,11 @@ private:
 
 #if VDRVERSNUM > 10704
   bool GetRecordingMetadata(const string& u, cMetadata& metadata){
+#if APIVERSNUM > 20101
+    string videoDir = string(cVideoDirectory::Name()), uri = u.substr(6), recStr = videoDir + "/" + uri;
+#else
     string videoDir = string(VideoDirectory), uri = u.substr(6), recStr = videoDir + "/" + uri;
+#endif
     cRecording* recording = Recordings.GetByName(recStr.c_str());
 
     if(!recording) return false;
diff --git a/plugins/provider/recProvider/recProvider.cpp b/plugins/provider/recProvider/recProvider.cpp
index 3a77435..b63fccd 100644
--- a/plugins/provider/recProvider/recProvider.cpp
+++ b/plugins/provider/recProvider/recProvider.cpp
@@ -27,7 +27,11 @@ private:
 
   bool GetFileStat(const string& uri, struct stat& fileStat){
     stringstream filename;
+#if APIVERSNUM > 20101
+    filename << cVideoDirectory::Name() << "/" << uri.substr(6);
+#else
     filename << VideoDirectory << "/" << uri.substr(6);
+#endif
     struct stat s;
     if(stat(filename.str().c_str(), &s) == 0){
       fileStat = s;
@@ -109,7 +113,11 @@ public:
     if(!HasRootContainer(u)) return StringList();
 
     StringList list;
+#if APIVERSNUM > 20101
+    string videoDir(cVideoDirectory::Name()), fs, uri = u.substr(6);
+#else
     string videoDir(VideoDirectory), fs, uri = u.substr(6);
+#endif
     int pos = 0, vl = videoDir.length(), ul = uri.length(), vul = vl + ul + 1;
 
     if(!initialScan){
@@ -142,7 +150,11 @@ public:
     if(GetRootContainer().compare(uri) == 0) return true;
 
     stringstream filename;
+#if APIVERSNUM > 20101
+    filename << cVideoDirectory::Name() << "/" << uri.substr(6);
+#else
     filename << VideoDirectory << "/" << uri.substr(6);
+#endif
 
     if(!Recordings.GetByName(filename.str().c_str())){
       return true;
@@ -203,7 +215,11 @@ public:
   virtual bool Open(const string& uri){
     if(!HasRootContainer(uri)) return false;
 
+#if APIVERSNUM > 20101
+    filename = string(cVideoDirectory::Name()) + "/" + uri.substr(6);
+#else
     filename = string(VideoDirectory) + "/" + uri.substr(6);
+#endif
     currentFileNumber = 1;
     return ScanFiles();
   }