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

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
Show changes
Commits on Source (2)
# [1.0.0-alpha.3](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2020-10-19)
### Bug Fixes
* **analytics:** remove charts empty values + remove useless language cache ([1678794](https://code.podlibre.org/podlibre/castopod/commit/16787941539ba4014281a366789ea896a9cd2afc))
# [1.0.0-alpha.2](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2020-10-19) # [1.0.0-alpha.2](https://code.podlibre.org/podlibre/castopod/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2020-10-19)
......
...@@ -44,7 +44,7 @@ class Install extends Controller ...@@ -44,7 +44,7 @@ class Install extends Controller
$dotenv->load(); $dotenv->load();
} catch (\Throwable $e) { } catch (\Throwable $e) {
return $this->createEnv(); $this->createEnv();
} }
// Check if the created .env file is writable to continue install process // Check if the created .env file is writable to continue install process
...@@ -139,8 +139,6 @@ class Install extends Controller ...@@ -139,8 +139,6 @@ class Install extends Controller
// Could not create the .env file, redirect to a view with manual instructions on how to add it // Could not create the .env file, redirect to a view with manual instructions on how to add it
return view('install/manual_config'); return view('install/manual_config');
} }
return redirect()->back();
} }
public function instanceConfig() public function instanceConfig()
......
...@@ -20,10 +20,4 @@ class AnalyticsWebsiteByEntryPage extends Entity ...@@ -20,10 +20,4 @@ class AnalyticsWebsiteByEntryPage extends Entity
'date' => 'datetime', 'date' => 'datetime',
'hits' => 'integer', 'hits' => 'integer',
]; ];
public function getLabels()
{
$split = explode('/', $this->attributes['labels']);
return $split[count($split) - 1];
}
} }
...@@ -8,13 +8,13 @@ if (!function_exists('host_url')) { ...@@ -8,13 +8,13 @@ if (!function_exists('host_url')) {
*/ */
function host_url() function host_url()
{ {
if (isset($_SERVER['host'])) { if (isset($_SERVER['HTTP_HOST'])) {
$protocol = $protocol =
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443 $_SERVER['SERVER_PORT'] == 443
? 'https://' ? 'https://'
: 'http://'; : 'http://';
return $protocol + $_SERVER['host']; return $protocol . $_SERVER['HTTP_HOST'] . '/';
} }
return false; return false;
......
...@@ -32,10 +32,9 @@ class AnalyticsPodcastByCountryModel extends Model ...@@ -32,10 +32,9 @@ class AnalyticsPodcastByCountryModel extends Model
*/ */
public function getDataWeekly(int $podcastId): array public function getDataWeekly(int $podcastId): array
{ {
$locale = service('request')->getLocale();
if ( if (
!($found = cache( !($found = cache(
"{$podcastId}_analytics_podcast_by_country_weekly_{$locale}" "{$podcastId}_analytics_podcast_by_country_weekly"
)) ))
) { ) {
$found = $this->select('`country_code` as `labels`') $found = $this->select('`country_code` as `labels`')
...@@ -49,7 +48,7 @@ class AnalyticsPodcastByCountryModel extends Model ...@@ -49,7 +48,7 @@ class AnalyticsPodcastByCountryModel extends Model
->findAll(10); ->findAll(10);
cache()->save( cache()->save(
"{$podcastId}_analytics_podcast_by_country_weekly_{$locale}", "{$podcastId}_analytics_podcast_by_country_weekly",
$found, $found,
600 600
); );
...@@ -66,10 +65,9 @@ class AnalyticsPodcastByCountryModel extends Model ...@@ -66,10 +65,9 @@ class AnalyticsPodcastByCountryModel extends Model
*/ */
public function getDataYearly(int $podcastId): array public function getDataYearly(int $podcastId): array
{ {
$locale = service('request')->getLocale();
if ( if (
!($found = cache( !($found = cache(
"{$podcastId}_analytics_podcast_by_country_yearly_{$locale}" "{$podcastId}_analytics_podcast_by_country_yearly"
)) ))
) { ) {
$found = $this->select('`country_code` as `labels`') $found = $this->select('`country_code` as `labels`')
...@@ -83,7 +81,7 @@ class AnalyticsPodcastByCountryModel extends Model ...@@ -83,7 +81,7 @@ class AnalyticsPodcastByCountryModel extends Model
->findAll(10); ->findAll(10);
cache()->save( cache()->save(
"{$podcastId}_analytics_podcast_by_country_yearly_{$locale}", "{$podcastId}_analytics_podcast_by_country_yearly",
$found, $found,
600 600
); );
......
...@@ -112,6 +112,7 @@ class AnalyticsPodcastByPlayerModel extends Model ...@@ -112,6 +112,7 @@ class AnalyticsPodcastByPlayerModel extends Model
->where([ ->where([
'`podcast_id`' => $podcastId, '`podcast_id`' => $podcastId,
'`app` !=' => '', '`app` !=' => '',
'`os` !=' => '',
'`bot`' => 0, '`bot`' => 0,
'`date` >' => date('Y-m-d', strtotime('-1 week')), '`date` >' => date('Y-m-d', strtotime('-1 week')),
]) ])
......
...@@ -33,7 +33,9 @@ class AnalyticsWebsiteByEntryPageModel extends Model ...@@ -33,7 +33,9 @@ class AnalyticsWebsiteByEntryPageModel extends Model
public function getData(int $podcastId): array public function getData(int $podcastId): array
{ {
if (!($found = cache("{$podcastId}_analytics_website_by_entry_page"))) { if (!($found = cache("{$podcastId}_analytics_website_by_entry_page"))) {
$found = $this->select('`entry_page` as `labels`') $found = $this->select(
'IF(`entry_page`=\'/\',\'/\',SUBSTRING_INDEX(`entry_page`,\'/\',-1)) as `labels`'
)
->selectSum('`hits`', '`values`') ->selectSum('`hits`', '`values`')
->where([ ->where([
'`podcast_id`' => $podcastId, '`podcast_id`' => $podcastId,
......
...@@ -64,7 +64,9 @@ class AnalyticsWebsiteByRefererModel extends Model ...@@ -64,7 +64,9 @@ class AnalyticsWebsiteByRefererModel extends Model
if ( if (
!($found = cache("{$podcastId}_analytics_website_by_domain_weekly")) !($found = cache("{$podcastId}_analytics_website_by_domain_weekly"))
) { ) {
$found = $this->select('`domain` as `labels`') $found = $this->select(
'SUBSTRING_INDEX(`domain`, \'.\', -2) as `labels`'
)
->selectSum('`hits`', '`values`') ->selectSum('`hits`', '`values`')
->where([ ->where([
'`podcast_id`' => $podcastId, '`podcast_id`' => $podcastId,
...@@ -95,7 +97,9 @@ class AnalyticsWebsiteByRefererModel extends Model ...@@ -95,7 +97,9 @@ class AnalyticsWebsiteByRefererModel extends Model
if ( if (
!($found = cache("{$podcastId}_analytics_website_by_domain_yearly")) !($found = cache("{$podcastId}_analytics_website_by_domain_yearly"))
) { ) {
$found = $this->select('`domain` as `labels`') $found = $this->select(
'SUBSTRING_INDEX(`domain`, \'.\', -2) as `labels`'
)
->selectSum('`hits`', '`values`') ->selectSum('`hits`', '`values`')
->where([ ->where([
'`podcast_id`' => $podcastId, '`podcast_id`' => $podcastId,
......
...@@ -15,7 +15,10 @@ ...@@ -15,7 +15,10 @@
'id' => 'hostname', 'id' => 'hostname',
'name' => 'hostname', 'name' => 'hostname',
'class' => 'form-input mb-4', 'class' => 'form-input mb-4',
'value' => old('hostname', host_url() ?? config('App')->baseURL), 'value' => old(
'hostname',
empty(host_url()) ? config('App')->baseURL : host_url()
),
'required' => 'required', 'required' => 'required',
]) ?> ]) ?>
......
{ {
"name": "podlibre/castopod", "name": "podlibre/castopod",
"version": "1.0.0-alpha2", "version": "1.0.0-alpha3",
"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.2", "version": "1.0.0-alpha.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "castopod", "name": "castopod",
"version": "1.0.0-alpha.2", "version": "1.0.0-alpha.3",
"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",
......