Эх сурвалжийг харах

Fixed MacOS cache file bug on Video module

TC pushbot 5 4 жил өмнө
parent
commit
8e369d46f9

+ 8 - 1
web/Video/backend/buildPlaylist.js

@@ -69,7 +69,12 @@ function scanPathForVideo(thisDir, thisStorageName){
             for (var k =0; k < playlistFilelist.length; k++){
                 //For each files in this folder
                 if (!filelib.isDir(playlistFilelist[k]) && validVideoFormat.indexOf(ext(playlistFilelist[k])) > -1 ){
-                    //This is a video file 
+                    //This is a video file extension file
+                    var filenameOnly = JSON.parse(JSON.stringify(playlistFilelist[k])).split("/").pop();
+                    if (filenameOnly.substr(0,2) == "._"){
+                        //MacOS caching files. Ignore this
+                        continue
+                    }
                     thisPlaylistObject["Files"].push(buildFileObject(playlistFilelist[k]));
                 }
             }
@@ -78,6 +83,7 @@ function scanPathForVideo(thisDir, thisStorageName){
         }
 
         //Build the unsorted file list
+        /*
         var unsortedFileList = [];
         for (var i = 0; i < validVideoFormat.length; i++){
             var unsortedFiles = filelib.aglob(walkPath + "/*." + validVideoFormat[i])
@@ -85,6 +91,7 @@ function scanPathForVideo(thisDir, thisStorageName){
                 unsortedFileList.push(buildFileObject(unsortedFiles[j]));
             }
         }
+        */
         
 
         //Push scan into results