mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update ImportJob model
This commit is contained in:
parent
16399e93fb
commit
fbc15e8a07
1 changed files with 15 additions and 1 deletions
|
@ -6,5 +6,19 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class ImportJob extends Model
|
||||
{
|
||||
//
|
||||
public function url()
|
||||
{
|
||||
return url("/i/import/job/{$this->uuid}/{$this->stage}");
|
||||
}
|
||||
|
||||
public function files()
|
||||
{
|
||||
return $this->hasMany(ImportData::class, 'job_id');
|
||||
}
|
||||
|
||||
public function mediaJson()
|
||||
{
|
||||
$path = storage_path("app/$this->media_json");
|
||||
return json_decode(file_get_contents($path), true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue