mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
DLNA (#1364)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user