2025-01-19 14:37:00 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Nexus\Database\NexusDB;
|
2025-04-17 01:39:40 +07:00
|
|
|
use Nexus\Torrent\TechnicalInformation;
|
2025-01-19 14:37:00 +08:00
|
|
|
|
|
|
|
|
class TorrentExtra extends NexusModel
|
|
|
|
|
{
|
|
|
|
|
public $timestamps = true;
|
|
|
|
|
|
2025-04-17 01:39:40 +07:00
|
|
|
protected $fillable = ['torrent_id', 'descr', 'ori_descr', 'media_info', 'nfo'];
|
2025-01-19 14:37:00 +08:00
|
|
|
|
|
|
|
|
public function torrent()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Torrent::class, 'torrent_id');
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-17 01:39:40 +07:00
|
|
|
protected $appends = ['media_info_summary'];
|
|
|
|
|
|
|
|
|
|
public function getMediaInfoSummaryAttribute(): array
|
|
|
|
|
{
|
|
|
|
|
$technicalInfo = new TechnicalInformation($this->media_info ?? '');
|
|
|
|
|
return $technicalInfo->getSummaryInfo();
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-19 14:37:00 +08:00
|
|
|
}
|