Skip to content

Commit

Permalink
fixed: feed detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed May 4, 2019
1 parent 554165b commit ff05fdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'pattern' => '(:all)/' . option('mauricerenck.podcaster.defaultFeed', 'feed'),
'action' => function ($slug) {
$podcasterUtils = new PodcasterUtils();
// !!! Von hier holen

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

if(option('mauricerenck.podcaster.statsInternal') === true) {
Expand Down Expand Up @@ -103,8 +103,7 @@
$episode = $podcasterUtils->getPageFromSlug($slug);
$podcasterUtils->setCurrentEpisode($episode);

// !!! FIXME
$podcast = $episode->siblings()->find('feed');
$podcast = $episode->siblings()->find(option('mauricerenck.podcaster.defaultFeed', 'feed'));

if(option('mauricerenck.podcaster.statsInternal') === true) {
$stats = new PodcasterStats();
Expand Down
6 changes: 3 additions & 3 deletions utils/PodcasterStatsMysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public function increaseDownloads($episode, string $trackingDate) {
$downloadDate = $this->formatTrackingDate($trackingDate);
$episodeStats = $this->getEpisodeStats($episode->uid(), $downloadDate);

// !!! FIXME
$podcast = str::slug($episode->siblings()->find('feed')->podcasterTitle());
$podcast = str::slug($episode->siblings()->find(option('mauricerenck.podcaster.defaultFeed', 'feed'))->podcasterTitle());

if(!$episodeStats) {
$this->setDownloads($podcast, $episode->uid(), $downloadDate);
return true;
Expand Down Expand Up @@ -162,4 +162,4 @@ private function formatTrackingDate($timestamp): string {
return date('Y-m-d', $timestamp);
}

}
}

0 comments on commit ff05fdb

Please sign in to comment.