First pass at centralized database reference. Closes #282 (#289)

* First pass at centralized database reference. Closes #282

* Add verbose logging option to launch.json

* Clear current broadcaster on stream end. Closes #285

* Fix typo in verbose launch args

* Add support for purging tailwind styles. For #224

* Don't need to pass db as param since it is stored

* Commit updated Javascript packages

Co-authored-by: Owncast <owncast@owncast.online>
This commit is contained in:
Gabe Kangas
2020-10-26 08:55:31 -07:00
committed by GitHub
parent 6d0aa4bdd1
commit 19e86b8c04
6 changed files with 69 additions and 33 deletions

View File

@@ -14,16 +14,16 @@ var Config *config
var _default config
type config struct {
ChatDatabaseFilePath string `yaml:"chatDatabaseFile"`
EnableDebugFeatures bool `yaml:"-"`
FFMpegPath string `yaml:"ffmpegPath"`
Files files `yaml:"files"`
InstanceDetails InstanceDetails `yaml:"instanceDetails"`
S3 S3 `yaml:"s3"`
VersionInfo string `yaml:"-"` // For storing the version/build number
VideoSettings videoSettings `yaml:"videoSettings"`
WebServerPort int `yaml:"webServerPort"`
YP YP `yaml:"yp"`
DatabaseFilePath string `yaml:"databaseFile"`
EnableDebugFeatures bool `yaml:"-"`
FFMpegPath string `yaml:"ffmpegPath"`
Files files `yaml:"files"`
InstanceDetails InstanceDetails `yaml:"instanceDetails"`
S3 S3 `yaml:"s3"`
VersionInfo string `yaml:"-"` // For storing the version/build number
VideoSettings videoSettings `yaml:"videoSettings"`
WebServerPort int `yaml:"webServerPort"`
YP YP `yaml:"yp"`
}
// InstanceDetails defines the user-visible information about this particular instance.
@@ -193,6 +193,14 @@ func (c *config) GetYPServiceHost() string {
return _default.YP.YPServiceURL
}
func (c *config) GetDataFilePath() string {
if c.DatabaseFilePath != "" {
return c.DatabaseFilePath
}
return _default.DatabaseFilePath
}
func (c *config) GetVideoStreamQualities() []StreamQuality {
if len(c.VideoSettings.StreamQualities) > 0 {
return c.VideoSettings.StreamQualities

View File

@@ -15,6 +15,7 @@ func getDefaults() config {
defaults.Files.MaxNumberInPlaylist = 5
defaults.YP.Enabled = false
defaults.YP.YPServiceURL = "https://yp.owncast.online"
defaults.DatabaseFilePath = "data/owncast.db"
defaultQuality := StreamQuality{
IsAudioPassthrough: true,