This commit is contained in:
WithoutPants
2021-05-20 16:58:43 +10:00
committed by GitHub
parent 0f579076b6
commit 76019af3e5
209 changed files with 15361 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ import (
"time"
"github.com/stashapp/stash/pkg/database"
"github.com/stashapp/stash/pkg/dlna"
"github.com/stashapp/stash/pkg/ffmpeg"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/manager/config"
@@ -35,6 +36,8 @@ type singleton struct {
DownloadStore *DownloadStore
DLNAService *dlna.Service
TxnManager models.TransactionManager
}
@@ -66,6 +69,11 @@ func Initialize() *singleton {
TxnManager: sqlite.NewTransactionManager(),
}
sceneServer := SceneServer{
TXNManager: instance.TxnManager,
}
instance.DLNAService = dlna.NewService(instance.TxnManager, instance.Config, &sceneServer)
if !cfg.IsNewSystem() {
logger.Infof("using config file: %s", cfg.GetConfigFile())
@@ -89,6 +97,11 @@ func Initialize() *singleton {
}
initFFMPEG()
// if DLNA is enabled, start it now
if instance.Config.GetDLNADefaultEnabled() {
instance.DLNAService.Start(nil)
}
})
return instance