Skip to content

A self-hosted media server and file management system

feat(indexing): add m4a to list of supported file types

aminnausin5fce2514496e
diff --git a/app/Jobs/EmbedUidInMetadata.php b/app/Jobs/EmbedUidInMetadata.php
index 5398a1b7..9d7d3f01 100644
--- a/app/Jobs/EmbedUidInMetadata.php
+++ b/app/Jobs/EmbedUidInMetadata.php
@@ -142,7 +142,7 @@ class EmbedUidInMetadata implements ShouldQueue {
$tempFilePath = $this->filePath . '.tmp';
- $formatMap = ['mp4' => 'mp4', 'mkv' => 'matroska', 'mp3' => 'mp3', 'ogg' => 'opus', 'flac' => 'flac'];
+ $formatMap = ['mp4' => 'mp4', 'm4a' => 'mp4', 'mkv' => 'matroska', 'mp3' => 'mp3', 'ogg' => 'opus', 'flac' => 'flac'];
$format = $formatMap[$ext] ?? $ext;
if ($ext === 'mp4') {
@@ -230,3 +230,25 @@ class EmbedUidInMetadata implements ShouldQueue {
}
}
}
+
+/*
+TEST:
+
+Writing to same disk (HDD) vs writing to cache disk (NVME SSD)
+
+File: 3.59 GB 25:37 Minute Long MP4 Recording
+
+=========================
+ RESULTS
+=========================
+Test 1 Cache Disk Method
+Write: 1.4006357 sec
+Move : 10.0204311 sec
+TOTAL: 11.4210668 sec
+-------------------------
+Test 2 Same Disk Method
+Write: 20.4764739 sec
+Move : 0.7254721 sec
+TOTAL: 21.201946 sec
+=========================
+*/
diff --git a/app/Jobs/IndexFiles.php b/app/Jobs/IndexFiles.php
index e887e057..d30715e5 100755
--- a/app/Jobs/IndexFiles.php
+++ b/app/Jobs/IndexFiles.php
@@ -464,7 +464,7 @@ class IndexFiles implements ShouldBeUnique, ShouldQueue {
// TODO: This line defines what file types are supported. Move this somewhere else that is easy to configure
$ext = pathinfo($file, PATHINFO_EXTENSION);
- if (strtolower($ext) !== 'mp4' && strtolower($ext) !== 'mkv' && strtolower($ext) !== 'mp3' && strtolower($ext) !== 'ogg' && strtolower($ext) !== 'flac' && strtolower($ext) !== 'webm') { // && strtolower($ext) !== 'ogg' && strtolower($ext) !== 'flac' the conversion breaks ogg idk about flac
+ if (strtolower($ext) !== 'mp4' && strtolower($ext) !== 'm4a' && strtolower($ext) !== 'mkv' && strtolower($ext) !== 'mp3' && strtolower($ext) !== 'ogg' && strtolower($ext) !== 'flac' && strtolower($ext) !== 'webm') { // && strtolower($ext) !== 'ogg' && strtolower($ext) !== 'flac' the conversion breaks ogg idk about flac
continue;
}