]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sun, 15 Nov 2020 09:43:44 +0000 (10:43 +0100)
committerVincent <vincent@enhydra.fr>
Sun, 15 Nov 2020 09:43:44 +0000 (10:43 +0100)
.idea/workspace.xml
config/media.php
scripts/lib/medialibrary.php

index f8c59a6f625dea5220e01d358243c81fd43a67e0..4bcb8eb0f321cefc3735e495d0614909f1d47151 100644 (file)
@@ -3,6 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/media.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/medialibrary.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/medialibrary.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1605087787424" duration="33487000" />
       <workItem from="1605261347643" duration="1199000" />
       <workItem from="1605342171398" duration="4613000" />
-      <workItem from="1605355486465" duration="15698000" />
-    </task>
-    <task id="LOCAL-00347" summary=".">
-      <created>1602863336459</created>
-      <option name="number" value="00347" />
-      <option name="presentableId" value="LOCAL-00347" />
-      <option name="project" value="LOCAL" />
-      <updated>1602863336459</updated>
+      <workItem from="1605355486465" duration="16791000" />
     </task>
     <task id="LOCAL-00348" summary=".">
       <created>1603131455368</created>
       <option name="project" value="LOCAL" />
       <updated>1605431934015</updated>
     </task>
-    <option name="localTasksCounter" value="396" />
+    <task id="LOCAL-00396" summary=".">
+      <created>1605432287214</created>
+      <option name="number" value="00396" />
+      <option name="presentableId" value="LOCAL-00396" />
+      <option name="project" value="LOCAL" />
+      <updated>1605432287214</updated>
+    </task>
+    <option name="localTasksCounter" value="397" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state x="740" y="229" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.1707.920@0.0.1707.920" timestamp="1604146905948" />
-    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605431931637">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605432284758">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="132" y="0" width="737" height="502" key="CommitChangelistDialog2/0.0.1707.920@0.0.1707.920" timestamp="1605086955514" />
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1605188136787" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605431931637" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605432284758" />
     <state x="952" y="244" key="FileChooserDialogImpl" timestamp="1605104496549">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index 0690f13442b71ed4d80e74794a538a8f58b4961a..8013755987f7068b78461ce4bef3f7011a8acb08 100644 (file)
@@ -52,6 +52,8 @@ $shortcuts['media'][] = ['label' => 'Recharger', 'type' => 'url', 'href' => '/sc
 
 function getMediaFolderShortcuts($mediagroup, $parentId)
 {
+
+
     $res['sub-' . $parentId] = array();
     if (!isset($mediagroup['items'])) {
         return $res;
@@ -63,7 +65,18 @@ function getMediaFolderShortcuts($mediagroup, $parentId)
             $res['sub-' . $parentId][] = array('label' => $item['name'], 'type' => 'sub', 'sub' => $pid);
             $res = array_merge($res, getMediaFolderShortcuts($item, $pid));
         } else {
-            $res['sub-' . $parentId][] = array('label' => $item['name'], 'type' => 'media', 'path' => $item['path']);
+            $unsupportedExt = [];
+            $unsupportedCodec = ['av1', 'hevc'];
+            if (config('VIDEOPLAYER') === 'shield') {
+                $unsupportedCodec = ['xvid'];
+                $unsupportedExt = ['avi'];
+            }
+            $e = explode('.', $item['path']);
+            $path = $item['path'];
+            if (in_array($e, $unsupportedExt) || in_array(getVideoCodec($item['path']), $unsupportedCodec)) {
+                $path = $item['x264path'];
+            }
+            $res['sub-' . $parentId][] = array('label' => $item['name'], 'type' => 'media', 'path' => $path);
         }
     }
 
index c7070e097ce3da194c576c3cd3225cd21d098000..5314852360fd08b1a067afc7e5e656d5a16fee78 100644 (file)
@@ -18,7 +18,7 @@ function getMediaContents($dir, $context, $seen = null)
                     continue;
                 }
                 $normPath = normPath($path);
-                $results[] = array('path' => $normPath, 'x264path' => getX264Version($path, false), 'srt' => hasSRT($normPath), 'seen' => seen($normPath), 'dir' => false, 'name' => mediaName(implode(' ', $e), $context, false, $path));
+                $results[] = array('path' => $normPath, 'ext' => $ext, 'codec' => getVideoCodec($path), 'x264path' => getX264Version($path, false), 'srt' => hasSRT($normPath), 'seen' => seen($normPath), 'dir' => false, 'name' => mediaName(implode(' ', $e), $context, false, $path));
             }
         } else if ($value != "." && $value != ".." && $value != '@eaDir') {
             $files = getMediaContents($path, $context, $seen);
@@ -29,7 +29,7 @@ function getMediaContents($dir, $context, $seen = null)
                 $results[] = $files[0];
             } else {
                 $normPath = normPath($path);
-                $results[] = array('path' => $normPath, 'x264path' => getX264Version($path, false), 'seen' => seen($normPath), 'dir' => true, 'id' => hash('sha256', $path), 'name' => mediaName($value, $context, true, $path), 'items' => $files);
+                $results[] = array('path' => $normPath, 'ext' => $ext, 'codec' => getVideoCodec($path), 'x264path' => getX264Version($path, false), 'seen' => seen($normPath), 'dir' => true, 'id' => hash('sha256', $path), 'name' => mediaName($value, $context, true, $path), 'items' => $files);
             }
         }
     }
@@ -142,7 +142,7 @@ function mediaName($name, $context, $dir, $path)
 function transcodeOneVideo()
 {
     if (getState('night') == '1') {
-        return;
+        //return;
     }
 
     $list = getVideosList(true);