update ca, sv language
[enigma2.git] / lib / service / servicefs.cpp
index 708825f6a702d2c7b8d1667bd61bf78d60644462..16948854484240a9af262edec8cad69c3e65315d 100644 (file)
@@ -96,6 +96,11 @@ eServiceFS::~eServiceFS()
 {
 }
 
+int lower(char c)
+{
+       return std::tolower(static_cast<unsigned char>(c));
+}
+
 RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
 {
        DIR *d=opendir(path.c_str());
@@ -131,6 +136,7 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
                {
                        size_t e = filename.rfind('.');
                        std::string extension = (e != std::string::npos) ? filename.substr(e) : "";
+                       std::transform(extension.begin(), extension.end(), extension.begin(), lower);
                        int type = -1;
                        
                        if (extension == ".ts")
@@ -145,6 +151,8 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
                                type = 4097;
                        else if (extension == ".wav" || extension == ".wave")
                                type = 4097;
+                       else if (extension == ".m3u" || extension == ".pls" || extension == ".e2pls")
+                               type = 4098;
                        
                        if (type != -1)
                        {
@@ -169,6 +177,7 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
 //   useable format options are
 //   R = Service Reference (as swig object .. this is very slow)
 //   S = Service Reference (as python string object .. same as ref.toString())
+//   C = Service Reference (as python string object .. same as ref.toCompareString())
 //   N = Service Name (as python string object)
 //   when exactly one return value per service is selected in the format string,
 //   then each value is directly a list entry
@@ -208,6 +217,9 @@ PyObject *eServiceFS::getContent(const char* format, bool sorted)
                                case 'R':  // service reference (swig)object
                                        tmp = New_eServiceReference(ref);
                                        break;
+                               case 'C':  // service reference compare string
+                                       tmp = PyString_FromString(ref.toCompareString().c_str());
+                                       break;
                                case 'S':  // service reference string
                                        tmp = PyString_FromString(ref.toString().c_str());
                                        break;