Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Fix setting DefaultMissingEPG sets dummy EPG for XMLTV but not for M3…
Browse files Browse the repository at this point in the history
…U output. Fix enabling automapping results in rebuilding XEPG database two times.
  • Loading branch information
SCP002 committed May 4, 2022
1 parent 125efd8 commit d378e7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
14 changes: 12 additions & 2 deletions src/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ func updateServerSettings(request RequestStruct) (settings SettingsStruct, err e
var createXEPGFiles = false
var debug string

// -vvv [URL] --sout '#transcode{vcodec=mp4v, acodec=mpga} :standard{access=http, mux=ogg}'

for key, value := range newSettings {

if _, ok := oldSettings[key]; ok {
Expand Down Expand Up @@ -102,6 +100,18 @@ func updateServerSettings(request RequestStruct) (settings SettingsStruct, err e
case "scheme.m3u", "scheme.xml":
createXEPGFiles = true

case "defaultMissingEPG":
// If DefaultMissingEPG was set, rebuild DVR and XEPG database
if newSettings["defaultMissingEPG"] != "-" && oldSettings["defaultMissingEPG"] == "-" {
reloadData = true
}

case "enableMappedChannels":
// If EnableMappedChannels was turned on, rebuild DVR and XEPG database
if newSettings["enableMappedChannels"] == true && oldSettings["enableMappedChannels"] == false {
reloadData = true
}

}

oldSettings[key] = value
Expand Down
16 changes: 0 additions & 16 deletions src/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ func WS(w http.ResponseWriter, r *http.Request) {
var previousTLSMode = Settings.TLSMode
var previousHostIP = Settings.HostIP
var previousStoreBufferInRAM = Settings.StoreBufferInRAM
var previousDefaultMissingEPG = Settings.DefaultMissingEPG
var previousEnableMappedChannels = Settings.EnableMappedChannels

response.Settings, err = updateServerSettings(request)
if err == nil {
Expand Down Expand Up @@ -496,20 +494,6 @@ func WS(w http.ResponseWriter, r *http.Request) {
initBufferVFS(Settings.StoreBufferInRAM)
}

if Settings.DefaultMissingEPG != "-" && previousDefaultMissingEPG == "-" {
// TODO: Probably will have to run these two when with auto enable it will not reflect changes in m3u
// buildDatabaseDVR()
// buildXEPG(false)
System.ScanInProgress = 1
mapping()
System.ScanInProgress = 0
}

if Settings.EnableMappedChannels && previousEnableMappedChannels == false {
buildDatabaseDVR()
buildXEPG(false)
}

}

case "saveFilesM3U":
Expand Down

0 comments on commit d378e7a

Please sign in to comment.