<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/scripts/kodi.php" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/scripts/lib/kodi.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/bricks.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/bricks.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/style/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.css" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/style/style.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.less" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/kodi.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/kodi.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" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="Make" enabled="true" />
</method>
</configuration>
- <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
- <option name="arquillianRunConfiguration">
- <value>
- <option name="containerStateName" value="" />
- </value>
- </option>
- <option name="TEST_OBJECT" value="class" />
- <method v="2">
- <option name="Make" enabled="true" />
- </method>
- </configuration>
<configuration default="true" type="ArquillianTestNG" factoryName="">
<option name="arquillianRunConfiguration">
<value>
<workItem from="1606936960189" duration="47000" />
<workItem from="1606937045400" duration="5193000" />
<workItem from="1607036021292" duration="44000" />
- <workItem from="1607084835284" duration="5921000" />
- </task>
- <task id="LOCAL-00368" summary=".">
- <created>1604390350662</created>
- <option name="number" value="00368" />
- <option name="presentableId" value="LOCAL-00368" />
- <option name="project" value="LOCAL" />
- <updated>1604390350662</updated>
+ <workItem from="1607084835284" duration="6328000" />
+ <workItem from="1607323219546" duration="4378000" />
</task>
<task id="LOCAL-00369" summary=".">
<created>1604396748171</created>
<option name="project" value="LOCAL" />
<updated>1606938157166</updated>
</task>
- <option name="localTasksCounter" value="417" />
+ <task id="LOCAL-00417" summary=".">
+ <created>1607282050429</created>
+ <option name="number" value="00417" />
+ <option name="presentableId" value="LOCAL-00417" />
+ <option name="project" value="LOCAL" />
+ <updated>1607282050429</updated>
+ </task>
+ <option name="localTasksCounter" value="418" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
// Update kodi database
foreach ($seen as $file => $s) {
$file = str_replace('//', '/', $file);
- if (!array_key_exists($file, $playCounts) || ($playCounts[$file] && $playCounts[$file] >= 0)) {
- continue;
+ $e = explode('.', $file);
+ $ext = array_pop($e);
+ array_push($e, 'x264');
+ array_push($e, $ext);
+ $x264 = implode('.', $e);
+
+ foreach ([$file, $x264] as $f) {
+ if (!array_key_exists($f, $playCounts) || ($playCounts[$f] && $playCounts[$f] >= 0)) {
+ continue;
+ }
+ $fileId = $files[$f];
+ mysqli_query($con, 'UPDATE files SET playCount=1,lastPlayed=NOW() WHERE idFile=' . $fileId);
}
- $fileId = $files[$file];
- mysqli_query($con, 'UPDATE files SET playCount=1,lastPlayed=NOW() WHERE idFile=' . $fileId);
+
+
}
}
\ No newline at end of file
////
////ffmpeg -i /volume1/Share/Videos/Séries/Westworld/S01/E01.mkv -c:v libx264 -crf 19 -preset slow -c:a aac -b:a 192k -ac 2 /volume1/Share/Videos/Séries/Westworld/S01/E01.x264.mkv
//
+
+
+function getTranscodedPath(SplFileInfo $item)
+{
+ $destext = $item->getExtension();
+ if ($destext === 'avi') {
+ $destext = 'mkv';
+ }
+ $normalized = $item->getRealPath();
+ $normalized = str_replace('/volume1/Share', '', $normalized);
+ $normalized = str_replace('/nas', '', $normalized);
+ $normalized = str_replace('/mnt/smb/share', '', $normalized);
+ $normalized = str_replace('/mnt/sshfs/share', '', $normalized);
+ $normalized = 'c' . $normalized;
+ return '/mnt/smb/share/Videos/Transcoded/' . sha1($normalized) . '.' . $destext;
+
+}
+
function transcodeOneVideo()
{
if (getState('night') == '1' || getState('device_avion_awake') == '0') {
/** @var SplFileInfo $item */
$path = $item->getRealPath();
- $to = preg_replace('/\.' . $item->getExtension() . '$/', '.x264.' . $destext, $path);
+ $to = getTranscodedPath($item);
+ $oldto = preg_replace('/\.' . $item->getExtension() . '$/', '.x264.' . $destext, $path);
+ if (file_exists($oldto)) {
+ if (!file_exists($to) || filesize($oldto) > filesize($to)) {
+ rename($oldto, $to);
+ }
+ continue;
+ }
if (file_exists($to) && filesize($to) != 0 && videosHaveSameDuration($path, $to)) {
continue;
if (!$f->isFile()) {
continue;
}
+ if (stristr($f->getPath(), 'Transcoded')) {
+ continue;
+ }
if (!in_array($f->getExtension(), $videoExt)) {
continue;
}