v2.1.0.0105: Settings for URI scheme

This commit is contained in:
marmei
2019-12-06 20:48:59 +01:00
parent 08f6fb60e3
commit 1a1e37fe15
15 changed files with 150 additions and 49 deletions

View File

@@ -223,6 +223,8 @@ func StartSystem(updateProviderFiles bool) (err error) {
return
}
setURLScheme()
// Systeminformationen in der Konsole ausgeben
showInfo(fmt.Sprintf("UUID:%s", Settings.UUID))
showInfo(fmt.Sprintf("Tuner (Plex / Emby):%d", Settings.Tuner))

View File

@@ -107,6 +107,9 @@ func updateServerSettings(request RequestStruct) (settings SettingsStrcut, err e
}
case "scheme.m3u", "scheme.xml":
createXEPGFiles = true
}
oldSettings[key] = value
@@ -141,6 +144,8 @@ func updateServerSettings(request RequestStruct) (settings SettingsStrcut, err e
return
}
setURLScheme()
if Settings.AuthenticationWEB == false {
Settings.AuthenticationAPI = false
@@ -505,11 +510,10 @@ func saveXEpgMapping(request RequestStruct) (err error) {
System.ScanInProgress = 1
cleanupXEPG()
//buildXEPG(true)
buildXEPG(true)
go func() {
mapping()
createXMLTVFile()
createM3UFile()
showInfo("XEPG:" + fmt.Sprintf("Ready to use"))
@@ -541,8 +545,7 @@ func saveXEpgMapping(request RequestStruct) (err error) {
System.ScanInProgress = 1
cleanupXEPG()
//buildXEPG(false)
mapping()
buildXEPG(false)
createXMLTVFile()
createM3UFile()
showInfo("XEPG:" + fmt.Sprintf("Ready to use"))

View File

@@ -45,7 +45,7 @@ func getCacheImageURL(imageURL string) (cacheImageURL string) {
if indexOfString(urlMD5+fileExtension, Data.Cache.ImagesCache) != -1 {
cacheImageURL = fmt.Sprintf("%s://%s/images/%s%s", System.ServerProtocol.WEB, System.Domain, urlMD5, fileExtension)
cacheImageURL = fmt.Sprintf("%s://%s/images/%s%s", System.ServerProtocol.XML, System.Domain, urlMD5, fileExtension)
} else {
@@ -163,7 +163,7 @@ func uploadLogo(input, filename string) (logoURL string, err error) {
return
}
logoURL = fmt.Sprintf("%s://%s/data_images/%s", System.ServerProtocol.WEB, System.Domain, filename)
logoURL = fmt.Sprintf("%s://%s/data_images/%s", System.ServerProtocol.XML, System.Domain, filename)
return

View File

@@ -279,6 +279,8 @@ type SettingsStrcut struct {
MappingFirstChannel float64 `json:"mapping.first.channel"`
Port string `json:"port"`
SSDP bool `json:"ssdp"`
SchemeM3U string `json:"scheme.m3u"`
SchemeXML string `json:"scheme.xml"`
TempPath string `json:"temp.path"`
Tuner int `json:"tuner"`
Update []string `json:"update"`

View File

@@ -41,6 +41,8 @@ type RequestStruct struct {
UserAgent *string `json:"user.agent,omitempty"`
XepgReplaceMissingImages *bool `json:"xepg.replace.missing.images,omitempty"`
XteveAutoUpdate *bool `json:"xteveAutoUpdate,omitempty"`
SchemeM3U *string `json:"scheme.m3u,omitempty"`
SchemeXML *string `json:"scheme.xml,omitempty"`
} `json:"settings,omitempty"`
// Upload Logo

View File

@@ -48,6 +48,7 @@ type Program struct {
PreviouslyShown *PreviouslyShown `xml:"previously-shown"`
New *New `xml:"new"`
Live *Live `xml:"live"`
Premiere *Live `xml:"premiere"`
}
// Title : Programmtitel

View File

@@ -138,6 +138,8 @@ func loadSettings() (settings SettingsStrcut, err error) {
defaults["version"] = System.DBVersion
defaults["xteveAutoUpdate"] = true
defaults["temp.path"] = System.Folder.Temp
defaults["scheme.M3U"] = "HTTP"
defaults["scheme.XML"] = "HTTP"
// Default Werte setzen
for key, value := range defaults {
@@ -252,6 +254,14 @@ func setGlobalDomain(domain string) {
return
}
func setURLScheme() {
System.ServerProtocol.M3U = strings.ToLower(Settings.SchemeM3U)
System.ServerProtocol.XML = strings.ToLower(Settings.SchemeXML)
return
}
// UUID generieren
func createUUID() (uuid string) {
uuid = time.Now().Format("2006-01") + "-" + randomString(4) + "-" + randomString(6)

File diff suppressed because one or more lines are too long

View File

@@ -717,6 +717,9 @@ func getProgramData(xepgChannel XEPGChannelStruct) (xepgXML XMLTV, err error) {
// Live
program.Live = xmltvProgram.Live
// Premiere
program.Premiere = xmltvProgram.Premiere
xepgXML.Program = append(xepgXML.Program, program)
}