minor fixes
This commit is contained in:
@@ -23,8 +23,12 @@
|
||||
|
||||
$title = trim((string) ($art->name ?? $art->title ?? 'Untitled artwork'));
|
||||
|
||||
$publisherType = (string) (data_get($art, 'publisher.type') ?? ($art->published_as_type ?? ''));
|
||||
$isGroupPublisher = $publisherType === 'group';
|
||||
|
||||
$author = trim((string) (
|
||||
$art->uname
|
||||
($isGroupPublisher ? data_get($art, 'publisher.name') : null)
|
||||
?? $art->uname
|
||||
?? $art->author_name
|
||||
?? $art->author
|
||||
?? ($art->user->name ?? null)
|
||||
@@ -32,11 +36,13 @@
|
||||
?? 'Skinbase'
|
||||
));
|
||||
|
||||
$username = trim((string) (
|
||||
$art->username
|
||||
?? ($art->user->username ?? null)
|
||||
?? ''
|
||||
));
|
||||
$username = $isGroupPublisher
|
||||
? ''
|
||||
: trim((string) (
|
||||
$art->username
|
||||
?? ($art->user->username ?? null)
|
||||
?? ''
|
||||
));
|
||||
|
||||
$rawContentType = trim((string) (
|
||||
$art->content_type_name
|
||||
@@ -61,7 +67,14 @@
|
||||
|
||||
$avatarUserId = $art->user->id ?? $art->user_id ?? null;
|
||||
$avatarHash = $art->user->profile->avatar_hash ?? $art->avatar_hash ?? null;
|
||||
$avatarUrl = \App\Support\AvatarUrl::forUser((int) ($avatarUserId ?? 0), $avatarHash, 64);
|
||||
$avatarUrl = trim((string) (
|
||||
($isGroupPublisher ? data_get($art, 'publisher.avatar_url') : null)
|
||||
?? ($art->avatar_url ?? null)
|
||||
?? ''
|
||||
));
|
||||
if ($avatarUrl === '') {
|
||||
$avatarUrl = \App\Support\AvatarUrl::forUser((int) ($avatarUserId ?? 0), $avatarHash, 64);
|
||||
}
|
||||
|
||||
$license = trim((string) ($art->license ?? 'Standard'));
|
||||
$resolution = trim((string) ($art->resolution ?? ((isset($art->width, $art->height) && $art->width && $art->height) ? ($art->width . '×' . $art->height) : '')));
|
||||
@@ -131,7 +144,14 @@
|
||||
$cardUrl = '#';
|
||||
}
|
||||
}
|
||||
$authorUrl = $username !== '' ? '/@' . strtolower($username) : null;
|
||||
$authorUrl = trim((string) (
|
||||
($isGroupPublisher ? data_get($art, 'publisher.profile_url') : null)
|
||||
?? ($art->profile_url ?? null)
|
||||
?? ($username !== '' ? '/@' . strtolower($username) : '')
|
||||
));
|
||||
if ($authorUrl === '') {
|
||||
$authorUrl = null;
|
||||
}
|
||||
|
||||
$metaParts = [];
|
||||
if ($contentType !== '') {
|
||||
|
||||
Reference in New Issue
Block a user