Skip to content

Commit

Permalink
fix: do not connect to db when internal stats are inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Aug 21, 2024
1 parent ab20c60 commit c37fec9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
4 changes: 4 additions & 0 deletions app/PodcasterDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class PodcasterDatabase
{
public function connect(string $dbType)
{
if (option('mauricerenck.podcaster.statsInternal') === false) {
return null;
}

try {
if ($dbType === 'mysql') {
$database = new Database([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,32 @@ Podcasteraudio: - file://PIrCmXQs1k0gJV41

----

Podcastercover: - file://NxwPC4OF9isofI1h

----
Podcastertranscript:

Podcasterseason: 1
-
podcastertranscriptlanguage: ar-KW
podcastertranscriptfile:
- file://Y1eW2AZeVUOh11pl
-
podcastertranscriptlanguage: de
podcastertranscriptfile:
- file://L10JTYu3jhtHgO3e

----

Podcasterepisode: 1
Podcastercover: - file://NxwPC4OF9isofI1h

----

Podcasterepisodetype: full
Podcasterseason: 1

----

Podcasterexplicit: true
Podcasterepisode: 1

----

Podcasterblock: false
Podcasterepisodetype: full

----

Expand All @@ -44,18 +49,18 @@ Podcasterdescription: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, s

Podcasterchapters:

-
-
podcasterchaptertimestamp: 00:10:00
podcasterchaptertitle: Chapter Title
podcasterchapterurl: https://chapter.tld
podcasterchapterimage:
- file://NxwPC4OF9isofI1h
-
-
podcasterchaptertimestamp: 00:20:00
podcasterchaptertitle: Second Chapter
podcasterchaptertitle: Second Chapter with ä ö ü ß
podcasterchapterurl: https://chapter.tld
podcasterchapterimage: [ ]
-
-
podcasterchaptertimestamp: 00:00:30
podcasterchaptertitle: chapter3
podcasterchapterurl: ""
Expand All @@ -67,7 +72,27 @@ Podcasterauthor: - user://9u0svKwr

----

Podcastercontributors: - user://9u0svKwr
Podcastercontributors:

-
contributorid: "1"
contributorname: Maurice Renck
contributoravatar: https://test.tld/avatar.png
contributorrole: "1"
contributorgroup: "1"
contributerid: "1"
contributername: Maurice Renck
contributeravatar: https://avatar.tld
contributerrole: "1"
contributergroup: "1"

----

Podcasterexplicit: true

----

Podcasterblock: false

----

Expand All @@ -87,4 +112,4 @@ Podcasterexplizit: true

----

Uuid: e4q0bSA0YNdECQ0X
Uuid: e4q0bSA0YNdECQ0X

0 comments on commit c37fec9

Please sign in to comment.