Merge pull request #30 from eai04191/feature-KomifloResolver
KomifloResolverに画像の取得を追加
This commit is contained in:
commit
b6bf1f99d8
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\MetadataResolver;
|
namespace App\MetadataResolver;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class KomifloResolver implements Resolver
|
class KomifloResolver implements Resolver
|
||||||
{
|
{
|
||||||
public function resolve(string $url): Metadata
|
public function resolve(string $url): Metadata
|
||||||
@ -21,6 +23,8 @@ class KomifloResolver implements Resolver
|
|||||||
$metadata->description = ($json['content']['attributes']['artists']['children'][0]['data']['name'] ?? '?') .
|
$metadata->description = ($json['content']['attributes']['artists']['children'][0]['data']['name'] ?? '?') .
|
||||||
' - ' .
|
' - ' .
|
||||||
($json['content']['parents'][0]['data']['title'] ?? '?');
|
($json['content']['parents'][0]['data']['title'] ?? '?');
|
||||||
|
$metadata->image = $json['content']['cdn_public'] . "/564_mobile_large_3x/" . $json['content']['named_imgs']['cover']['filename'] . $json['content']['signature'];
|
||||||
|
$metadata->expires_at = Carbon::parse($json['content']['signature_expires'])->setTimezone(config('app.timezone'));
|
||||||
|
|
||||||
return $metadata;
|
return $metadata;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user