Initial Ombi integration

When enabled, an account for the user is created on both Jellyfin and
Ombi. Account defaults can be stored similarly to jf.
This commit is contained in:
Harvey Tindall
2020-09-05 17:32:49 +01:00
parent 9850545f1b
commit ba67fa7536
11 changed files with 493 additions and 30 deletions
+12 -4
View File
@@ -7,10 +7,10 @@ import (
)
type Storage struct {
timePattern string
invite_path, emails_path, policy_path, configuration_path, displayprefs_path string
invites Invites
emails, policy, configuration, displayprefs map[string]interface{}
timePattern string
invite_path, emails_path, policy_path, configuration_path, displayprefs_path, ombi_path string
invites Invites
emails, policy, configuration, displayprefs, ombi_template map[string]interface{}
}
// timePattern: %Y-%m-%dT%H:%M:%S.%f
@@ -67,6 +67,14 @@ func (st *Storage) storeDisplayprefs() error {
return storeJSON(st.displayprefs_path, st.displayprefs)
}
func (st *Storage) loadOmbiTemplate() error {
return loadJSON(st.ombi_path, &st.ombi_template)
}
func (st *Storage) storeOmbiTemplate() error {
return storeJSON(st.ombi_path, st.ombi_template)
}
func loadJSON(path string, obj interface{}) error {
var file []byte
var err error