Skip to content

A self-hosted media server and file management system

feat: raw metadata jsonb column to cache ffprobe output on metadata

aminnausinfc8f6752b259
diff --git a/app/Models/Metadata.php b/app/Models/Metadata.php
index ea1666e7..c46ffabd 100644
--- a/app/Models/Metadata.php
+++ b/app/Models/Metadata.php
@@ -59,6 +59,8 @@ class Metadata extends Model {
* intro_duration -> float(2) (nullable)
*
* first_file_modified_at -> timestamptz (nullable)
+ *
+ * raw_metadata -> jsonb (nullable)
*/
protected $fillable = [
// Id
@@ -92,6 +94,7 @@ class Metadata extends Model {
'resolution_height',
'frame_rate',
'media_type',
+ 'raw_metadata',
// API Editable
'view_count',
@@ -116,6 +119,8 @@ class Metadata extends Model {
'intro_start' => 'float',
'intro_duration' => 'float',
+
+ 'raw_metadata' => 'array',
];
public function video(): BelongsTo {
diff --git a/database/migrations/2026_03_31_015208_add_cached_metadata_to_metadata.php b/database/migrations/2026_03_31_015208_add_cached_metadata_to_metadata.php
new file mode 100644
index 00000000..8af55a74
--- /dev/null
+++ b/database/migrations/2026_03_31_015208_add_cached_metadata_to_metadata.php
@@ -0,0 +1,25 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+ /**
+ * Run the migrations.
+ */
+ public function up(): void {
+ Schema::table('metadata', function (Blueprint $table) {
+ $table->jsonb('raw_metadata')->nullable();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {
+ Schema::table('metadata', function (Blueprint $table) {
+ $table->dropColumn('raw_metadata');
+ });
+ }
+};