allow some more media types, fix extension detection
[enigma2.git] / lib / service / servicefs.cpp
index 8254e63b672ee732ec523562e62ccd9b906cc99d..c53e055e6a2a135be19be9c6ef65ceeff88272b5 100644 (file)
@@ -129,10 +129,24 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
                        list.push_back(service);
                } else
                {
-                               /* FIIIIIX ME */
-                       if (filename.substr(filename.size()-3) == ".ts")
+                       size_t e = filename.rfind('.');
+                       std::string extension = (e != std::string::npos) ? filename.substr(e) : "";
+                       int type = -1;
+                       
+                       if (extension == ".ts")
+                               type = eServiceFactoryDVB::id;
+                       else if (extension == ".mp3" || extension == ".ogg" || extension == ".avi")
+                               type = 4097;
+                       else if (extension == ".ogg")
+                               type = 4097;
+                       else if (extension == ".mpg")
+                               type = 4097;
+                       else if (extension == ".vob")
+                               type = 4097;
+                       
+                       if (type != -1)
                        {
-                               eServiceReference service(eServiceFactoryDVB::id,
+                               eServiceReference service(type,
                                        0,
                                        filename);
                                service.data[0] = 0;