Commit 5d02ae39 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(podcast-import): move guid attribute declaration for Episode entity to include slug data

parent a281abfd
Pipeline #1130 failed with stages
in 10 minutes and 2 seconds
......@@ -345,9 +345,9 @@ class PodcastImportController extends BaseController
$newEpisode = new Episode([
'podcast_id' => $newPodcastId,
'guid' => $item->guid ?? null,
'title' => $item->title,
'slug' => $slug,
'guid' => $item->guid ?? null,
'audio_file' => download_file((string) $item->enclosure->attributes()['url']),
'description_markdown' => $converter->convert($itemDescriptionHtml),
'description_html' => $itemDescriptionHtml,
......
......@@ -420,7 +420,7 @@ class Episode extends Entity
public function getLink(): string
{
return base_url(route_to('episode', $this->getPodcast() ->name, $this->attributes['slug']));
return url_to('episode', $this->getPodcast()->name, $this->attributes['slug']);
}
public function getEmbeddablePlayerUrl(string $theme = null): string
......
......@@ -125,7 +125,7 @@ class FavouriteModel extends UuidModel
$likeActivity = new LikeActivity();
$likeActivity
->set('id', base_url(route_to('activity', $actor->username, $activity->id)))
->set('id', url_to('activity', $actor->username, $activity->id))
->set('actor', $actor->uri)
->set('object', $status->uri);
......
......@@ -83,7 +83,7 @@ class FollowModel extends Model
'queued',
);
$followActivity->set('id', base_url(route_to('activity', $actor->username, $activityId)));
$followActivity->set('id', url_to('activity', $actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......
......@@ -278,7 +278,7 @@ class StatusModel extends UuidModel
if ($registerActivity) {
// set status id and uri to construct NoteObject
$status->id = $newStatusId;
$status->uri = base_url(route_to('status', $status->actor->username, $newStatusId));
$status->uri = url_to('status', $status->actor->username, $newStatusId);
$createActivity = new CreateActivity();
$noteObjectClass = config('ActivityPub')
......@@ -298,7 +298,7 @@ class StatusModel extends UuidModel
'queued',
);
$createActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$createActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -411,7 +411,7 @@ class StatusModel extends UuidModel
'queued',
);
$deleteActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$deleteActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -492,7 +492,7 @@ class StatusModel extends UuidModel
'queued',
);
$announceActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$announceActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -535,10 +535,7 @@ class StatusModel extends UuidModel
->first();
$announceActivity = new AnnounceActivity($reblogStatus);
$announceActivity->set(
'id',
base_url(route_to('activity', $reblogStatus->actor->username, $activity->id)),
);
$announceActivity->set('id', url_to('activity', $reblogStatus->actor->username, $activity->id),);
$undoActivity
->set('actor', $reblogStatus->actor->uri)
......@@ -555,7 +552,7 @@ class StatusModel extends UuidModel
'queued',
);
$undoActivity->set('id', base_url(route_to('activity', $reblogStatus->actor->username, $activityId)));
$undoActivity->set('id', url_to('activity', $reblogStatus->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -627,7 +624,7 @@ class StatusModel extends UuidModel
$actor = model('ActorModel')
->getActorById((int) $data['data']['actor_id']);
$data['data']['uri'] = base_url(route_to('status', $actor->username, $uuid4->toString()));
$data['data']['uri'] = url_to('status', $actor->username, $uuid4->toString());
}
return $data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment