Skip to content

A self-hosted media server and file management system

feat: add videos relation to series by same folder_id

aminnausin46cb935191d3
diff --git a/app/Models/Series.php b/app/Models/Series.php
index 529e2320..9f0eb821 100644
--- a/app/Models/Series.php
+++ b/app/Models/Series.php
@@ -102,6 +102,10 @@ class Series extends Model {
return $this->belongsTo(Folder::class);
}
+ public function videos(): HasMany {
+ return $this->hasMany(Video::class, 'folder_id', 'folder_id');
+ }
+
public function editor(): BelongsTo {
return $this->belongsTo(User::class);
}