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
# [1.0.0-alpha.46](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.45...v1.0.0-alpha.46) (2021-04-09)
### Bug Fixes
* **episodes-page:** handle defaultQuery being null when no podcast episodes ([15183b7](https://code.podlibre.org/podlibre/castopod/commit/15183b7eab57dac007bcdfa8c3651239de1ae05a)), closes [#100](https://code.podlibre.org/podlibre/castopod/issues/100)
# [1.0.0-alpha.45](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2021-04-08) # [1.0.0-alpha.45](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2021-04-08)
......
...@@ -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.45'); defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.46');
/* /*
| -------------------------------------------------------------------- | --------------------------------------------------------------------
......
...@@ -69,10 +69,12 @@ class Podcast extends BaseController ...@@ -69,10 +69,12 @@ class Podcast extends BaseController
$defaultQuery = (new EpisodeModel())->getDefaultQuery( $defaultQuery = (new EpisodeModel())->getDefaultQuery(
$this->podcast->id, $this->podcast->id,
); );
if ($defaultQuery['type'] == 'season') { if ($defaultQuery) {
$seasonQuery = $defaultQuery['data']['season_number']; if ($defaultQuery['type'] == 'season') {
} elseif ($defaultQuery['type'] == 'year') { $seasonQuery = $defaultQuery['data']['season_number'];
$yearQuery = $defaultQuery['data']['year']; } elseif ($defaultQuery['type'] == 'year') {
$yearQuery = $defaultQuery['data']['year'];
}
} }
} }
...@@ -81,7 +83,7 @@ class Podcast extends BaseController ...@@ -81,7 +83,7 @@ class Podcast extends BaseController
array_filter([ array_filter([
'page', 'page',
"podcast{$this->podcast->id}", "podcast{$this->podcast->id}",
$yearQuery, $yearQuery ? 'year' . $yearQuery : null,
$seasonQuery ? 'season' . $seasonQuery : null, $seasonQuery ? 'season' . $seasonQuery : null,
service('request')->getLocale(), service('request')->getLocale(),
]), ]),
......
...@@ -314,7 +314,7 @@ class EpisodeModel extends Model ...@@ -314,7 +314,7 @@ class EpisodeModel extends Model
* *
* @param int $podcastId * @param int $podcastId
* *
* @return array * @return array|null
*/ */
public function getDefaultQuery(int $podcastId) public function getDefaultQuery(int $podcastId)
{ {
...@@ -419,11 +419,11 @@ class EpisodeModel extends Model ...@@ -419,11 +419,11 @@ class EpisodeModel extends Model
foreach ($years as $year) { foreach ($years as $year) {
cache()->delete( cache()->delete(
"podcast{$episode->podcast_id}_{$year['year']}_episodes", "podcast{$episode->podcast_id}_year{$year['year']}_episodes",
); );
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$episode->podcast_id}_{$year['year']}_{$locale}", "page_podcast{$episode->podcast_id}_year{$year['year']}_{$locale}",
); );
} }
} }
......
...@@ -38,7 +38,7 @@ class PageModel extends Model ...@@ -38,7 +38,7 @@ class PageModel extends Model
protected function clearCache(array $data) protected function clearCache(array $data)
{ {
$page = (new PageModel())->find( $page = (new PageModel())->find(
is_array($data['id']) ? $data['id'][0] : $data['id'] is_array($data['id']) ? $data['id'][0] : $data['id'],
); );
// delete page cache // delete page cache
...@@ -57,14 +57,14 @@ class PageModel extends Model ...@@ -57,14 +57,14 @@ class PageModel extends Model
foreach ($years as $year) { foreach ($years as $year) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_{$year['year']}_{$locale}" "page_podcast{$podcast->id}_year{$year['year']}_{$locale}",
); );
} }
} }
foreach ($seasons as $season) { foreach ($seasons as $season) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_season{$season['season_number']}_{$locale}" "page_podcast{$podcast->id}_season{$season['season_number']}_{$locale}",
); );
} }
} }
...@@ -72,7 +72,7 @@ class PageModel extends Model ...@@ -72,7 +72,7 @@ class PageModel extends Model
foreach ($podcast->episodes as $episode) { foreach ($podcast->episodes as $episode) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_episode{$episode->id}_{$locale}" "page_podcast{$podcast->id}_episode{$episode->id}_{$locale}",
); );
} }
} }
......
...@@ -36,7 +36,7 @@ class PlatformModel extends Model ...@@ -36,7 +36,7 @@ class PlatformModel extends Model
if (!($found = cache('platforms'))) { if (!($found = cache('platforms'))) {
$baseUrl = rtrim(config('app')->baseURL, '/'); $baseUrl = rtrim(config('app')->baseURL, '/');
$found = $this->select( $found = $this->select(
"*, CONCAT('{$baseUrl}/assets/images/platforms/',`type`,'/',`slug`,'.svg') as icon" "*, CONCAT('{$baseUrl}/assets/images/platforms/',`type`,'/',`slug`,'.svg') as icon",
)->findAll(); )->findAll();
cache()->save('platforms', $found, DECADE); cache()->save('platforms', $found, DECADE);
} }
...@@ -75,12 +75,12 @@ class PlatformModel extends Model ...@@ -75,12 +75,12 @@ class PlatformModel extends Model
!($found = cache("podcast{$podcastId}_platforms_{$platformType}")) !($found = cache("podcast{$podcastId}_platforms_{$platformType}"))
) { ) {
$found = $this->select( $found = $this->select(
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player' 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player',
) )
->join( ->join(
'podcasts_platforms', 'podcasts_platforms',
"podcasts_platforms.platform_slug = platforms.slug AND podcasts_platforms.podcast_id = $podcastId", "podcasts_platforms.platform_slug = platforms.slug AND podcasts_platforms.podcast_id = $podcastId",
'left' 'left',
) )
->where('platforms.type', $platformType) ->where('platforms.type', $platformType)
->findAll(); ->findAll();
...@@ -88,7 +88,7 @@ class PlatformModel extends Model ...@@ -88,7 +88,7 @@ class PlatformModel extends Model
cache()->save( cache()->save(
"podcast{$podcastId}_platforms_{$platformType}", "podcast{$podcastId}_platforms_{$platformType}",
$found, $found,
DECADE DECADE,
); );
} }
...@@ -99,15 +99,15 @@ class PlatformModel extends Model ...@@ -99,15 +99,15 @@ class PlatformModel extends Model
{ {
if ( if (
!($found = cache( !($found = cache(
"podcast{$podcastId}_podcastPlatforms_{$platformType}" "podcast{$podcastId}_podcastPlatforms_{$platformType}",
)) ))
) { ) {
$found = $this->select( $found = $this->select(
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player' 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player',
) )
->join( ->join(
'podcasts_platforms', 'podcasts_platforms',
'podcasts_platforms.platform_slug = platforms.slug' 'podcasts_platforms.platform_slug = platforms.slug',
) )
->where('podcasts_platforms.podcast_id', $podcastId) ->where('podcasts_platforms.podcast_id', $podcastId)
->where('platforms.type', $platformType) ->where('platforms.type', $platformType)
...@@ -116,7 +116,7 @@ class PlatformModel extends Model ...@@ -116,7 +116,7 @@ class PlatformModel extends Model
cache()->save( cache()->save(
"podcast{$podcastId}_podcastPlatforms_{$platformType}", "podcast{$podcastId}_podcastPlatforms_{$platformType}",
$found, $found,
DECADE DECADE,
); );
} }
...@@ -133,11 +133,11 @@ class PlatformModel extends Model ...@@ -133,11 +133,11 @@ class PlatformModel extends Model
$podcastsPlatformsTable = $this->db->prefixTable('podcasts_platforms'); $podcastsPlatformsTable = $this->db->prefixTable('podcasts_platforms');
$platformsTable = $this->db->prefixTable('platforms'); $platformsTable = $this->db->prefixTable('platforms');
$deleteJoinQuery = <<<EOD $deleteJoinQuery = <<<EOD
DELETE $podcastsPlatformsTable DELETE $podcastsPlatformsTable
FROM $podcastsPlatformsTable FROM $podcastsPlatformsTable
INNER JOIN $platformsTable ON $platformsTable.slug = $podcastsPlatformsTable.platform_slug INNER JOIN $platformsTable ON $platformsTable.slug = $podcastsPlatformsTable.platform_slug
WHERE `podcast_id` = ? AND `type` = ? WHERE `podcast_id` = ? AND `type` = ?
EOD; EOD;
$this->db->query($deleteJoinQuery, [$podcastId, $platformType]); $this->db->query($deleteJoinQuery, [$podcastId, $platformType]);
// Set podcastPlatforms // Set podcastPlatforms
...@@ -173,7 +173,7 @@ EOD; ...@@ -173,7 +173,7 @@ EOD;
foreach (['podcasting', 'social', 'funding'] as $platformType) { foreach (['podcasting', 'social', 'funding'] as $platformType) {
cache()->delete("podcast{$podcastId}_platforms_{$platformType}"); cache()->delete("podcast{$podcastId}_platforms_{$platformType}");
cache()->delete( cache()->delete(
"podcast{$podcastId}_podcastPlatforms_{$platformType}" "podcast{$podcastId}_podcastPlatforms_{$platformType}",
); );
} }
// delete localized podcast page cache // delete localized podcast page cache
...@@ -185,7 +185,7 @@ EOD; ...@@ -185,7 +185,7 @@ EOD;
foreach ($years as $year) { foreach ($years as $year) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcastId}_{$year['year']}_{$locale}" "page_podcast{$podcastId}_year{$year['year']}_{$locale}",
); );
} }
} }
...@@ -193,7 +193,7 @@ EOD; ...@@ -193,7 +193,7 @@ EOD;
foreach ($seasons as $season) { foreach ($seasons as $season) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcastId}_season{$season['season_number']}_{$locale}" "page_podcast{$podcastId}_season{$season['season_number']}_{$locale}",
); );
} }
} }
...@@ -202,14 +202,14 @@ EOD; ...@@ -202,14 +202,14 @@ EOD;
foreach ($podcast->episodes as $episode) { foreach ($podcast->episodes as $episode) {
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_episode{$episode->id}_{$locale}" "page_podcast{$podcast->id}_episode{$episode->id}_{$locale}",
); );
foreach ( foreach (
array_keys(\App\Models\EpisodeModel::$themes) array_keys(\App\Models\EpisodeModel::$themes)
as $themeKey as $themeKey
) { ) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_episode{$episode->id}_embeddable_player_{$themeKey}_{$locale}" "page_podcast{$podcast->id}_episode{$episode->id}_embeddable_player_{$themeKey}_{$locale}",
); );
} }
} }
......
...@@ -241,10 +241,12 @@ class PodcastModel extends Model ...@@ -241,10 +241,12 @@ class PodcastModel extends Model
$seasons = $episodeModel->getSeasons($podcast->id); $seasons = $episodeModel->getSeasons($podcast->id);
foreach ($years as $year) { foreach ($years as $year) {
cache()->delete("podcast{$podcast->id}_{$year['year']}_episodes"); cache()->delete(
"podcast{$podcast->id}_year{$year['year']}_episodes",
);
foreach ($supportedLocales as $locale) { foreach ($supportedLocales as $locale) {
cache()->delete( cache()->delete(
"page_podcast{$podcast->id}_{$year['year']}_{$locale}", "page_podcast{$podcast->id}_year{$year['year']}_{$locale}",
); );
} }
} }
......
{ {
"name": "podlibre/castopod", "name": "podlibre/castopod",
"version": "1.0.0-alpha45", "version": "1.0.0-alpha46",
"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.45", "version": "1.0.0-alpha.46",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "castopod", "name": "castopod",
"version": "1.0.0-alpha.45", "version": "1.0.0-alpha.46",
"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",
......