Skip to content

Commit

Permalink
Merge pull request #18 from mauricerenck/develop
Browse files Browse the repository at this point in the history
Fixes some issue
  • Loading branch information
mauricerenck authored May 14, 2019
2 parents 62a0c2f + 6671293 commit 9301d98
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "[email protected]"
}
],
"version": "1.0.4",
"version": "1.0.5",
"autoload": {
"files": [
"utils/PodcasterUtils.php",
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
'action' => function ($slug) {
$podcasterUtils = new PodcasterUtils();

$page = $podcasterUtils->getPageFromSlug($slug. '/' . option('mauricerenck.podcaster.defaultFeed', 'feed'));
$page = $podcasterUtils->getPageFromSlug($slug . '/' . option('mauricerenck.podcaster.defaultFeed', 'feed'));

if(option('mauricerenck.podcaster.statsInternal') === true) {
$stats = new PodcasterStats();
Expand Down
2 changes: 1 addition & 1 deletion templates/podcasterfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@

<?php if ($user = $page->podcasterAuthor()->toUser()) : ?>
<googleplay:author><?php echo Xml::encode($user->name()); ?></googleplay:author>
<googleplay:email><?php echo Xml::encode($user->email()); ?></googleplay:email>
<?php endif ?>
<googleplay:email><?php echo Xml::encode($user->email()); ?></googleplay:email>
<?php $rssUtils->printFieldValue('rssFeed', 'googleplay:description', 'podcasterDescription'); ?>
<?php $rssUtils->printBoolValue('rssFeed', 'googleplay:explicit', 'podcasterExplicit'); ?>
<?php $rssUtils->printBoolValue('rssFeed', 'googleplay:block', 'podcasterBlock'); ?>
Expand Down
5 changes: 3 additions & 2 deletions utils/PodcasterUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function printItunesCategories() {
}

public function getCoverImage() {
if($this->rssFeed->podcasterCover()->isNotEmpty()) {

if($this->rssFeed->podcasterCover()->isNotEmpty() && !is_null($this->rssFeed->podcasterCover()->toFile())) {
$output = '<image>';
$output .= '<url>' . Xml::encode($this->rssFeed->podcasterCover()->toFile()->url()) . '</url>';
$output .= '<title>' . Xml::encode($this->rssFeed->podcasterTitle()) . '</title>';
Expand Down Expand Up @@ -153,7 +154,7 @@ private function parseItunesCategories(): array {

public function getPageFromSlug($slug) {
$currentLanguage = kirby()->language();
$cleanedSlug = str_replace($currentLanguage . '/', '', $slug);
$cleanedSlug = (is_null($currentLanguage)) ? $slug : str_replace($currentLanguage . '/', '', $slug);

return page($cleanedSlug);
}
Expand Down

0 comments on commit 9301d98

Please sign in to comment.