Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • adaures/castopod
  • mkljczk/castopod-host
  • spaetz/castopod-host
  • PatrykMis/castopod
  • jonas/castopod
  • ajeremias/castopod
  • misuzu/castopod
  • KrzysztofDomanczyk/castopod
  • Behel/castopod
  • nebulon/castopod
  • ewen/castopod
  • NeoluxConsulting/castopod
  • nateritter/castopod-og
  • prcutler/castopod
14 results
Select Git revision
Show changes
Commits on Source (2)
# [1.0.0-alpha.52](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.51...v1.0.0-alpha.52) (2021-04-16)
### Bug Fixes
* **avatar:** use default avatar when no avatar url has been set ([9d23c7e](https://code.podlibre.org/podlibre/castopod/commit/9d23c7e7e142c6cf1a1418e37e41d711064593c4)), closes [#111](https://code.podlibre.org/podlibre/castopod/issues/111)
# [1.0.0-alpha.51](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.50...v1.0.0-alpha.51) (2021-04-15) # [1.0.0-alpha.51](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.50...v1.0.0-alpha.51) (2021-04-15)
......
...@@ -11,4 +11,15 @@ class ActivityPub extends ActivityPubBase ...@@ -11,4 +11,15 @@ class ActivityPub extends ActivityPubBase
*/ */
public $actorObject = 'App\Libraries\PodcastActor'; public $actorObject = 'App\Libraries\PodcastActor';
public $noteObject = 'App\Libraries\NoteObject'; public $noteObject = 'App\Libraries\NoteObject';
/**
* --------------------------------------------------------------------
* Default avatar and cover images
* --------------------------------------------------------------------
*/
public $defaultAvatarImagePath = 'assets/images/castopod-avatar-default.jpg';
public $defaultAvatarImageMimetype = 'image/jpeg';
public $defaultCoverImagePath = 'assets/images/castopod-cover-default.jpg';
public $defaultCoverImageMimetype = 'image/jpeg';
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
| |
| NOTE: this constant is updated upon release with Continuous Integration. | NOTE: this constant is updated upon release with Continuous Integration.
*/ */
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.51'); defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.52');
/* /*
| -------------------------------------------------------------------- | --------------------------------------------------------------------
......
...@@ -19,4 +19,15 @@ class ActivityPub extends BaseConfig ...@@ -19,4 +19,15 @@ class ActivityPub extends BaseConfig
*/ */
public $actorObject = 'ActivityPub\Objects\ActorObject'; public $actorObject = 'ActivityPub\Objects\ActorObject';
public $noteObject = 'ActivityPub\Objects\NoteObject'; public $noteObject = 'ActivityPub\Objects\NoteObject';
/**
* --------------------------------------------------------------------
* Default avatar and cover images
* --------------------------------------------------------------------
*/
public $defaultAvatarImagePath = 'assets/images/avatar-default.jpg';
public $defaultAvatarImageMimetype = 'image/jpeg';
public $defaultCoverImagePath = 'assets/images/cover-default.jpg';
public $defaultCoverImageMimetype = 'image/jpeg';
} }
...@@ -54,12 +54,14 @@ class AddActors extends Migration ...@@ -54,12 +54,14 @@ class AddActors extends Migration
'avatar_image_url' => [ 'avatar_image_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
'null' => true,
], ],
// constraint is 13 because the longest safe mimetype for images is image/svg+xml, // constraint is 13 because the longest safe mimetype for images is image/svg+xml,
// see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#image_types // see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#image_types
'avatar_image_mimetype' => [ 'avatar_image_mimetype' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 13, 'constraint' => 13,
'null' => true,
], ],
'cover_image_url' => [ 'cover_image_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
......
...@@ -36,8 +36,8 @@ class Actor extends Entity ...@@ -36,8 +36,8 @@ class Actor extends Entity
'summary' => '?string', 'summary' => '?string',
'private_key' => '?string', 'private_key' => '?string',
'public_key' => '?string', 'public_key' => '?string',
'avatar_image_url' => 'string', 'avatar_image_url' => '?string',
'avatar_image_mimetype' => 'string', 'avatar_image_mimetype' => '?string',
'cover_image_url' => '?string', 'cover_image_url' => '?string',
'cover_image_mimetype' => '?string', 'cover_image_mimetype' => '?string',
'inbox_url' => 'string', 'inbox_url' => 'string',
...@@ -81,4 +81,40 @@ class Actor extends Entity ...@@ -81,4 +81,40 @@ class Actor extends Entity
return $this->followers; return $this->followers;
} }
public function getAvatarImageUrl()
{
if (empty($this->attributes['avatar_image_url'])) {
return base_url(config('ActivityPub')->defaultAvatarImagePath);
}
return $this->attributes['avatar_image_url'];
}
public function getAvatarImageMimetype()
{
if (empty($this->attributes['avatar_image_mimetype'])) {
return config('ActivityPub')->defaultAvatarImageMimetype;
}
return $this->attributes['avatar_image_mimetype'];
}
public function getCoverImageUrl()
{
if (empty($this->attributes['cover_image_url'])) {
return base_url(config('ActivityPub')->defaultCoverImagePath);
}
return $this->attributes['cover_image_url'];
}
public function getCoverImageMimetype()
{
if (empty($this->attributes['cover_image_mimetype'])) {
return config('ActivityPub')->defaultCoverImageMimetype;
}
return $this->attributes['cover_image_mimetype'];
}
} }
...@@ -91,13 +91,12 @@ class ActorObject extends ObjectType ...@@ -91,13 +91,12 @@ class ActorObject extends ObjectType
$this->outbox = $actor->outbox_url; $this->outbox = $actor->outbox_url;
$this->followers = $actor->followers_url; $this->followers = $actor->followers_url;
if ($actor->cover_image_url) { $this->image = [
$this->image = [ 'type' => 'Image',
'type' => 'Image', 'mediaType' => $actor->cover_image_mimetype,
'mediaType' => $actor->cover_image_mimetype, 'url' => $actor->cover_image_url,
'url' => $actor->cover_image_url, ];
];
}
$this->icon = [ $this->icon = [
'type' => 'Image', 'type' => 'Image',
'mediaType' => $actor->avatar_image_mimetype, 'mediaType' => $actor->avatar_image_mimetype,
......
...@@ -297,12 +297,6 @@ class PodcastModel extends Model ...@@ -297,12 +297,6 @@ class PodcastModel extends Model
'public_key' => $publickey, 'public_key' => $publickey,
'display_name' => $data['data']['title'], 'display_name' => $data['data']['title'],
'summary' => $data['data']['description_html'], 'summary' => $data['data']['description_html'],
'avatar_image_url' => '',
'avatar_image_mimetype' => '',
'cover_image_url' => base_url(
'assets/images/castopod-cover-default.jpg',
),
'cover_image_mimetype' => 'image/jpeg',
'inbox_url' => url_to('inbox', $username), 'inbox_url' => url_to('inbox', $username),
'outbox_url' => url_to('outbox', $username), 'outbox_url' => url_to('outbox', $username),
'followers_url' => url_to('followers', $username), 'followers_url' => url_to('followers', $username),
...@@ -342,6 +336,7 @@ class PodcastModel extends Model ...@@ -342,6 +336,7 @@ class PodcastModel extends Model
$actor->display_name = $podcast->title; $actor->display_name = $podcast->title;
$actor->summary = $podcast->description_html; $actor->summary = $podcast->description_html;
$actor->avatar_image_url = $podcast->image->thumbnail_url; $actor->avatar_image_url = $podcast->image->thumbnail_url;
$actor->avatar_image_mimetype = $podcast->image_mimetype;
if ($actor->hasChanged()) { if ($actor->hasChanged()) {
$actorModel->update($actor->id, $actor); $actorModel->update($actor->id, $actor);
......
app/Views/_assets/images/castopod-avatar-default.jpg

9.29 KiB

<header id="main-header" class="fixed top-0 left-0 flex-col flex-shrink-0 h-screen transform -translate-x-full sm:left-auto sm:-translate-x-0 sm:sticky w-80 sm:w-64 lg:w-80 xl:w-112 sm:flex"> <header id="main-header" class="fixed top-0 left-0 flex-col flex-shrink-0 h-screen transform -translate-x-full sm:left-auto sm:-translate-x-0 sm:sticky w-80 sm:w-64 lg:w-80 xl:w-112 sm:flex">
<?php if ($podcast->actor->cover_image_url): ?> <img src="<?= $podcast->actor
<img src="<?= $podcast->actor ->cover_image_url ?>" alt="" class="object-cover w-full h-48 bg-pine-900"/>
->cover_image_url ?>" alt="" class="object-cover w-full h-48 bg-pine-900"/>
<?php else: ?>
<div class="w-full h-48 bg-pine-900"></div>
<?php endif; ?>
<div class="flex items-center justify-between px-4 py-2 mb-4 lg:px-6 -mt-14 lg:-mt-16 xl:-mt-20"> <div class="flex items-center justify-between px-4 py-2 mb-4 lg:px-6 -mt-14 lg:-mt-16 xl:-mt-20">
<img src="<?= $podcast->image <img src="<?= $podcast->image
->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-24 rounded-full shadow-xl xl:h-36 lg:h-28 ring-4 ring-pine-50" /> ->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-24 rounded-full shadow-xl xl:h-36 lg:h-28 ring-4 ring-pine-50" />
......
...@@ -31,11 +31,7 @@ ...@@ -31,11 +31,7 @@
'ActivityPub.follow.subtitle', 'ActivityPub.follow.subtitle',
) ?></h1> ) ?></h1>
<div class="flex flex-col w-full max-w-xs -mt-24 overflow-hidden bg-white shadow rounded-xl"> <div class="flex flex-col w-full max-w-xs -mt-24 overflow-hidden bg-white shadow rounded-xl">
<?php if ($actor->cover_image_url): ?>
<img src="<?= $actor->cover_image_url ?>" alt="" class="object-cover w-full h-32 bg-pine-800" /> <img src="<?= $actor->cover_image_url ?>" alt="" class="object-cover w-full h-32 bg-pine-800" />
<?php else: ?>
<div class="w-full h-32 bg-pine-800"></div>
<?php endif; ?>
<div class="flex px-4 py-2"> <div class="flex px-4 py-2">
<img src="<?= $actor->avatar_image_url ?>" alt="<?= $actor->display_name ?>" <img src="<?= $actor->avatar_image_url ?>" alt="<?= $actor->display_name ?>"
class="w-16 h-16 mr-4 -mt-8 rounded-full shadow-xl ring-2 ring-white" /> class="w-16 h-16 mr-4 -mt-8 rounded-full shadow-xl ring-2 ring-white" />
......
{ {
"name": "podlibre/castopod", "name": "podlibre/castopod",
"version": "1.0.0-alpha51", "version": "1.0.0-alpha52",
"type": "project", "type": "project",
"description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.", "description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://castopod.org", "homepage": "https://castopod.org",
......
{ {
"name": "castopod", "name": "castopod",
"version": "1.0.0-alpha.51", "version": "1.0.0-alpha.52",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "castopod", "name": "castopod",
"version": "1.0.0-alpha.51", "version": "1.0.0-alpha.52",
"description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.", "description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"private": true, "private": true,
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
......