refacto: revert podcast to title prop to show on bar

This commit is contained in:
Michel Roux 2024-01-14 00:40:52 +01:00
parent 6b6d21fa2f
commit 818124534b
5 changed files with 8 additions and 9 deletions

View File

@ -13,6 +13,7 @@ use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
* @psalm-import-type EpisodeActionType from EpisodeAction
*
* @psalm-type EpisodeActionExtraDataType = array{
* title: string,
* url: ?string,
* name: string,
* link: ?string,
@ -30,6 +31,7 @@ use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
class EpisodeActionExtraData implements \JsonSerializable
{
public function __construct(
private string $title,
private ?string $url,
private string $name,
private ?string $link,
@ -102,6 +104,7 @@ class EpisodeActionExtraData implements \JsonSerializable
public function toArray(): array {
return
[
'title' => $this->title,
'url' => $this->url,
'name' => $this->name,
'link' => $this->link,

View File

@ -27,6 +27,7 @@ class EpisodeActionReader extends CoreEpisodeActionReader
$episodes = [];
$xml = new \SimpleXMLElement($xmlString);
$channel = $xml->channel;
$title = (string) $channel->title;
// Find episode by url and add data for it
/** @var \SimpleXMLElement $item */
@ -108,6 +109,7 @@ class EpisodeActionReader extends CoreEpisodeActionReader
$pubDate = $rawPubDate ? new \DateTime($rawPubDate) : null;
$episodes[] = new EpisodeActionExtraData(
$title,
$url,
$name,
$link,

View File

@ -41,7 +41,7 @@
:link="modalEpisode.link"
:name="modalEpisode.name"
:size="modalEpisode.size"
:title="title"
:title="modalEpisode.title"
:url="modalEpisode.url" />
</NcModal>
</div>
@ -74,12 +74,6 @@ export default {
PlayButton,
StopButton,
},
props: {
title: {
type: String,
required: true,
},
},
data() {
return {
episodes: [],

View File

@ -4,7 +4,7 @@
<strong>{{ player.episode.name }}</strong>
</a>
<router-link :to="hash">
<i>{{ player.episode.podcast }}</i>
<i>{{ player.episode.title }}</i>
</router-link>
</div>
</template>

View File

@ -14,7 +14,7 @@
:image-url="feed.imageUrl"
:link="feed.link"
:title="feed.title" />
<Episodes v-if="feed" :title="feed.title" />
<Episodes v-if="feed" />
</NcAppContent>
</template>