diff --git a/apiGo/api/Settings.go b/apiGo/api/Settings.go
index 59a1fd7..63210e4 100644
--- a/apiGo/api/Settings.go
+++ b/apiGo/api/Settings.go
@@ -53,6 +53,7 @@ func getSettingsFromDB() {
* @apiSuccess {string} MediacenterName overall name of the mediacenter
* @apiSuccess {string} Pasword new server password (-1 if no password set)
* @apiSuccess {bool} DarkMode Darkmode enabled?
+ * @apiSuccess {bool} TVShowEnabled is are TVShows enabled
*/
AddHandler("loadInitialData", SettingsNode, func(info *HandlerInfo) []byte {
sett := settings.LoadSettings()
@@ -63,6 +64,7 @@ func getSettingsFromDB() {
MediacenterName string
VideoPath string
TVShowPath string
+ TVShowEnabled bool
}
regexMatchUrl := regexp.MustCompile("^http(|s)://([0-9]){1,3}\\.([0-9]){1,3}\\.([0-9]){1,3}\\.([0-9]){1,3}:[0-9]{1,5}")
@@ -77,6 +79,7 @@ func getSettingsFromDB() {
MediacenterName: sett.MediacenterName,
VideoPath: serverVideoPath,
TVShowPath: serverTVShowPath,
+ TVShowEnabled: settings.TVShowsEnabled(),
}
str, _ := json.Marshal(res)
diff --git a/apiGo/api/TVShows.go b/apiGo/api/TVShows.go
index 20dae62..7969392 100644
--- a/apiGo/api/TVShows.go
+++ b/apiGo/api/TVShows.go
@@ -3,9 +3,15 @@ package api
import (
"fmt"
"openmediacenter/apiGo/database"
+ "openmediacenter/apiGo/database/settings"
)
func AddTvshowHandlers() {
+ // do not add handlers if tvshows not enabled
+ if !settings.TVShowsEnabled() {
+ return
+ }
+
/**
* @api {post} /api/tvshow [getTVShows]
* @apiDescription get all available tv shows
diff --git a/apiGo/database/settings/Settings.go b/apiGo/database/settings/Settings.go
new file mode 100644
index 0000000..409a071
--- /dev/null
+++ b/apiGo/database/settings/Settings.go
@@ -0,0 +1,11 @@
+package settings
+
+var tvShowEnabled bool
+
+func TVShowsEnabled() bool {
+ return tvShowEnabled
+}
+
+func SetTVShowEnabled(enabled bool) {
+ tvShowEnabled = enabled
+}
diff --git a/apiGo/main.go b/apiGo/main.go
index 0b52cb2..80e138c 100644
--- a/apiGo/main.go
+++ b/apiGo/main.go
@@ -7,6 +7,7 @@ import (
"net/http"
"openmediacenter/apiGo/api"
"openmediacenter/apiGo/database"
+ settings2 "openmediacenter/apiGo/database/settings"
"openmediacenter/apiGo/static"
"openmediacenter/apiGo/videoparser"
)
@@ -55,8 +56,12 @@ func handleCommandLineArguments() (*database.DatabaseConfig, bool, *string) {
pathPrefix := flag.String("ReindexPrefix", "/var/www/openmediacenter", "Prefix path for videos to reindex")
+ disableTVShowSupport := flag.Bool("DisableTVSupport", false, "Disable the TVShow support and pages")
+
flag.Parse()
+ settings2.SetTVShowEnabled(!*disableTVShowSupport)
+
return &database.DatabaseConfig{
DBHost: *dbhostPtr,
DBPort: *dbPortPtr,
diff --git a/src/App.test.js b/src/App.test.js
index 6d231a3..57f45ce 100644
--- a/src/App.test.js
+++ b/src/App.test.js
@@ -18,6 +18,11 @@ describe('