feat: add total duration for playlist

This commit is contained in:
2026-06-15 11:39:09 +03:30
parent 81a7d19222
commit a7e3f2cbd8
3 changed files with 9 additions and 1 deletions
+6
View File
@@ -71,4 +71,10 @@ public function getTotalDurationAttribute()
{
return $this->musics()->where('music.is_active', true)->sum('music.duration');
}
// Total play time of the playlist = sum of its active musics' durations.
public function getDurationAttribute()
{
return $this->total_duration;
}
}