Add multi-language audio tracks and self-hosted flag-icons
Introduce per-video language support and multiple audio tracks (VideoAudioTrack model + migrations for language, description, title), a reusable language-select component, and a track-editor form. Bundle the self-hosted flag-icons v7.2.3 library and a NAS auto-sync command. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
1 parent
f8d13457fa
commit
66fd78c10f
314 files changed
+16507
-3172
No files matched your search
@@ -30,6 +30,7 @@ class Video extends Model
|
||||
'share_count',
|
||||
'share_token',
|
||||
'slideshow_video_path',
|
||||
'language',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@@ -64,6 +65,11 @@ class Video extends Model
|
||||
return $this->hasMany(VideoSlide::class)->orderBy('position');
|
||||
}
|
||||
|
||||
public function audioTracks()
|
||||
{
|
||||
return $this->hasMany(\App\Models\VideoAudioTrack::class)->orderBy('id');
|
||||
}
|
||||
|
||||
public function hasSlideshow(): bool
|
||||
{
|
||||
return $this->slides()->count() > 1;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class VideoAudioTrack extends Model
|
||||
{
|
||||
protected $fillable = ['video_id', 'language', 'label', 'title', 'description', 'path', 'filename'];
|
||||
|
||||
public function video(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Video::class);
|
||||
}
|
||||
|
||||
public function getStreamUrlAttribute(): string
|
||||
{
|
||||
return route('videos.audio-track', ['video' => $this->video_id, 'track' => $this->id]);
|
||||
}
|
||||
|
||||
/** Absolute local path to the file, regardless of NAS or local storage. */
|
||||
public function localPath(): string
|
||||
{
|
||||
return storage_path('app/' . $this->path);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user