Track overall progress across multiple XEPG runs XEPG Daten erstellen
()
| 46 | |
| 47 | // XEPG Daten erstellen |
| 48 | func buildXEPG() chan bool { |
| 49 | // Completely disable background XEPG when webserver.go is handling it |
| 50 | if webserverXEPGInProgress { |
| 51 | showInfo("XEPG: BACKGROUND XEPG DISABLED - webserver.go is handling XEPG processing") |
| 52 | completionChan := make(chan bool, 1) |
| 53 | completionChan <- true |
| 54 | return completionChan |
| 55 | } |
| 56 | |
| 57 | // Prevent duplicate XEPG processing when webserver.go is handling it |
| 58 | if xepgProcessingInProgress { |
| 59 | showInfo("XEPG: Skipping background processing - already in progress via webserver.go") |
| 60 | completionChan := make(chan bool, 1) |
| 61 | completionChan <- true |
| 62 | return completionChan |
| 63 | } |
| 64 | |
| 65 | // Set flag to indicate background XEPG is running |
| 66 | xepgProcessingInProgress = true |
| 67 | defer func() { |
| 68 | xepgProcessingInProgress = false |
| 69 | showInfo("XEPG: Background processing flag cleared") |
| 70 | }() |
| 71 | |
| 72 | completionChan := make(chan bool, 1) |
| 73 | |
| 74 | xepgMutex.Lock() |
| 75 | defer func() { |
| 76 | xepgMutex.Unlock() |
| 77 | }() |
| 78 | |
| 79 | // Clear streaming URL cache |
| 80 | Data.Cache.StreamingURLS = make(map[string]StreamInfo) |
| 81 | saveMapToJSONFile(System.File.URLS, Data.Cache.StreamingURLS) |
| 82 | |
| 83 | var err error |
| 84 | |
| 85 | Data.Cache.Images, err = imgcache.New(System.Folder.ImagesCache, fmt.Sprintf("%s://%s/images/", System.ServerProtocol.WEB, System.Domain), Settings.CacheImages) |
| 86 | if err != nil { |
| 87 | ShowError(err, 0) |
| 88 | } |
| 89 | |
| 90 | if Settings.EpgSource == "XEPG" { |
| 91 | |
| 92 | // Always use background processing for better user experience |
| 93 | // This prevents the interface from being locked during heavy operations |
| 94 | go func() { |
| 95 | |
| 96 | showDebug("XEPG: Starting background processing...", 1) |
| 97 | |
| 98 | createXEPGMapping() |
| 99 | |
| 100 | // Send progress update for mapping - continue from previous progress |
| 101 | globalXEPGProgress = 40 |
| 102 | broadcastProgressUpdate(ProcessingProgress{ |
| 103 | Percentage: globalXEPGProgress, |
| 104 | Current: 0, |
| 105 | Total: 1, |
no test coverage detected