mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
API: torrents upload/list
This commit is contained in:
@@ -3,16 +3,25 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Nexus\Database\NexusDB;
|
||||
use Nexus\Torrent\TechnicalInformation;
|
||||
|
||||
class TorrentExtra extends NexusModel
|
||||
{
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = ['torrent_id', 'descr', 'ori_descr', 'media_info'];
|
||||
protected $fillable = ['torrent_id', 'descr', 'ori_descr', 'media_info', 'nfo'];
|
||||
|
||||
public function torrent()
|
||||
{
|
||||
return $this->belongsTo(Torrent::class, 'torrent_id');
|
||||
}
|
||||
|
||||
protected $appends = ['media_info_summary'];
|
||||
|
||||
public function getMediaInfoSummaryAttribute(): array
|
||||
{
|
||||
$technicalInfo = new TechnicalInformation($this->media_info ?? '');
|
||||
return $technicalInfo->getSummaryInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user