Skip to content

Commit c37fec9

Browse files
committed
fix: do not connect to db when internal stats are inactive
1 parent ab20c60 commit c37fec9

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

app/PodcasterDatabase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ class PodcasterDatabase
88
{
99
public function connect(string $dbType)
1010
{
11+
if (option('mauricerenck.podcaster.statsInternal') === false) {
12+
return null;
13+
}
14+
1115
try {
1216
if ($dbType === 'mysql') {
1317
$database = new Database([

content/phpunit/podcast-seasons/1_season01/202101062145_episode-1/episode.en.txt

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,32 @@ Podcasteraudio: - file://PIrCmXQs1k0gJV41
66

77
----
88

9-
Podcastercover: - file://NxwPC4OF9isofI1h
10-
11-
----
9+
Podcastertranscript:
1210

13-
Podcasterseason: 1
11+
-
12+
podcastertranscriptlanguage: ar-KW
13+
podcastertranscriptfile:
14+
- file://Y1eW2AZeVUOh11pl
15+
-
16+
podcastertranscriptlanguage: de
17+
podcastertranscriptfile:
18+
- file://L10JTYu3jhtHgO3e
1419

1520
----
1621

17-
Podcasterepisode: 1
22+
Podcastercover: - file://NxwPC4OF9isofI1h
1823

1924
----
2025

21-
Podcasterepisodetype: full
26+
Podcasterseason: 1
2227

2328
----
2429

25-
Podcasterexplicit: true
30+
Podcasterepisode: 1
2631

2732
----
2833

29-
Podcasterblock: false
34+
Podcasterepisodetype: full
3035

3136
----
3237

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

4550
Podcasterchapters:
4651

47-
-
52+
-
4853
podcasterchaptertimestamp: 00:10:00
4954
podcasterchaptertitle: Chapter Title
5055
podcasterchapterurl: https://chapter.tld
5156
podcasterchapterimage:
5257
- file://NxwPC4OF9isofI1h
53-
-
58+
-
5459
podcasterchaptertimestamp: 00:20:00
55-
podcasterchaptertitle: Second Chapter
60+
podcasterchaptertitle: Second Chapter with ä ö ü ß
5661
podcasterchapterurl: https://chapter.tld
5762
podcasterchapterimage: [ ]
58-
-
63+
-
5964
podcasterchaptertimestamp: 00:00:30
6065
podcasterchaptertitle: chapter3
6166
podcasterchapterurl: ""
@@ -67,7 +72,27 @@ Podcasterauthor: - user://9u0svKwr
6772

6873
----
6974

70-
Podcastercontributors: - user://9u0svKwr
75+
Podcastercontributors:
76+
77+
-
78+
contributorid: "1"
79+
contributorname: Maurice Renck
80+
contributoravatar: https://test.tld/avatar.png
81+
contributorrole: "1"
82+
contributorgroup: "1"
83+
contributerid: "1"
84+
contributername: Maurice Renck
85+
contributeravatar: https://avatar.tld
86+
contributerrole: "1"
87+
contributergroup: "1"
88+
89+
----
90+
91+
Podcasterexplicit: true
92+
93+
----
94+
95+
Podcasterblock: false
7196

7297
----
7398

@@ -87,4 +112,4 @@ Podcasterexplizit: true
87112

88113
----
89114

90-
Uuid: e4q0bSA0YNdECQ0X
115+
Uuid: e4q0bSA0YNdECQ0X

0 commit comments

Comments
 (0)