Skip to content

A self-hosted media server and file management system

feat: add album and artist fields to metadata

aminnausin97204db8e3cd
diff --git a/app/Models/Metadata.php b/app/Models/Metadata.php
index 5e5ee2e5..1e18a1e1 100644
--- a/app/Models/Metadata.php
+++ b/app/Models/Metadata.php
@@ -36,6 +36,8 @@ class Metadata extends Model {
'date_scanned',
'date_uploaded',
'media_type',
+ 'album',
+ 'artist',
];
protected $casts = [
diff --git a/database/migrations/2025_06_04_042010_add_artist_and_album_to_metadata.php b/database/migrations/2025_06_04_042010_add_artist_and_album_to_metadata.php
new file mode 100644
index 00000000..6ec3e955
--- /dev/null
+++ b/database/migrations/2025_06_04_042010_add_artist_and_album_to_metadata.php
@@ -0,0 +1,27 @@
+<?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->string('artist')->nullable();
+ $table->string('album')->nullable();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {
+ Schema::table('metadata', function (Blueprint $table) {
+ $table->dropColumn('artist');
+ $table->dropColumn('album');
+ });
+ }
+};
diff --git a/resources/js/types/model.ts b/resources/js/types/model.ts
index 5e370f4b..56c8d3aa 100644
--- a/resources/js/types/model.ts
+++ b/resources/js/types/model.ts
@@ -45,6 +45,8 @@ export interface Metadata {
editor?: User;
poster_url?: string;
playbacks?: Playback[];
+ artist?: string;
+ album?: string;
video_tags?: VideoTag[];
media_type: MediaTypeValue;
}