fix linter warnings

one method to add handlers
This commit is contained in:
2021-09-21 10:45:52 +02:00
parent b10fbd6142
commit 334c54be4a
11 changed files with 37 additions and 20 deletions

9
apiGo/api/API.go Normal file
View File

@ -0,0 +1,9 @@
package api
func AddHandlers() {
addVideoHandlers()
addSettingsHandlers()
addTagHandlers()
addActorsHandlers()
addTvshowHandlers()
}

View File

@ -7,7 +7,7 @@ import (
"openmediacenter/apiGo/database"
)
func AddActorsHandlers() {
func addActorsHandlers() {
saveActorsToDB()
getActorsFromDB()
}

View File

@ -11,7 +11,7 @@ import (
"strings"
)
func AddSettingsHandlers() {
func addSettingsHandlers() {
saveSettingsToDB()
getSettingsFromDB()
reIndexHandling()

View File

@ -7,7 +7,7 @@ import (
"openmediacenter/apiGo/database"
)
func AddTvshowHandlers() {
func addTvshowHandlers() {
// do not add handlers if tvshows not enabled
if config.GetConfig().Features.DisableTVSupport {
return

View File

@ -7,7 +7,7 @@ import (
"regexp"
)
func AddTagHandlers() {
func addTagHandlers() {
getFromDB()
addToDB()
deleteFromDB()

View File

@ -11,7 +11,7 @@ import (
"strconv"
)
func AddVideoHandlers() {
func addVideoHandlers() {
getVideoHandlers()
loadVideosHandlers()
addToVideoHandlers()

View File

@ -55,7 +55,10 @@ func callHandler(ctx *apicontext, handler func(ctx Context), writer http.Respons
}
}
func ServerInit() {
func ServerInit(port uint16) error {
// initialize auth service and add corresponding auth routes
InitOAuth()
fmt.Printf("OpenMediacenter server up and running on port %d\n", port)
return http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
}