MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / buildXEPG

Function buildXEPG

src/xepg.go:48–175  ·  view source on GitHub ↗

Track overall progress across multiple XEPG runs XEPG Daten erstellen

()

Source from the content-addressed store, hash-verified

46
47// XEPG Daten erstellen
48func 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,

Callers 13

ShowSystemInfoFunction · 0.85
maintenanceFunction · 0.85
updateServerSettingsFunction · 0.85
saveFilesFunction · 0.85
updateFileFunction · 0.85
saveFilterFunction · 0.85
saveXEpgMappingFunction · 0.85
saveWizardFunction · 0.85
processStartupWorkflowFunction · 0.85
APIFunction · 0.85
enablePPVFunction · 0.85
disablePPVFunction · 0.85

Calls 13

NewFunction · 0.92
showInfoFunction · 0.85
saveMapToJSONFileFunction · 0.85
ShowErrorFunction · 0.85
showDebugFunction · 0.85
createXEPGMappingFunction · 0.85
broadcastProgressUpdateFunction · 0.85
createXEPGDatabaseFunction · 0.85
mappingFunction · 0.85
cleanupXEPGFunction · 0.85
createXMLTVFileFunction · 0.85
createM3UFileFunction · 0.85

Tested by

no test coverage detected