MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / maintenance

Function maintenance

src/maintenance.go:20–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func maintenance() {
21
22 for {
23
24 var t = time.Now()
25
26 // Aktualisierung der Playlist und XMLTV Dateien
27 for _, schedule := range Settings.Update {
28
29 if schedule == t.Format("1504") {
30
31 showInfo("Update:" + schedule)
32
33 // Backup erstellen
34 err := ThreadfinAutoBackup()
35 if err != nil {
36 ShowError(err, 000)
37 }
38
39 // Playlist und XMLTV Dateien aktualisieren
40 getProviderData("m3u", "")
41 getProviderData("hdhr", "")
42
43 if Settings.EpgSource == "XEPG" {
44 getProviderData("xmltv", "")
45 }
46
47 // Datenbank für DVR erstellen
48 err = buildDatabaseDVR()
49 if err != nil {
50 ShowError(err, 000)
51 }
52
53 systemMutex.Lock()
54 if !Settings.CacheImages && System.ImageCachingInProgress == 0 {
55 systemMutex.Unlock()
56 removeChildItems(System.Folder.ImagesCache)
57 } else {
58 systemMutex.Unlock()
59 }
60
61 // XEPG Dateien erstellen
62 buildXEPG()
63
64 }
65
66 }
67
68 // Update Threadfin (Binary)
69 systemMutex.Lock()
70 if System.TimeForAutoUpdate == t.Format("1504") {
71 systemMutex.Unlock()
72 BinaryUpdate()
73 } else {
74 systemMutex.Unlock()
75 }
76
77

Callers 1

InitMaintenanceFunction · 0.85

Calls 8

showInfoFunction · 0.85
ThreadfinAutoBackupFunction · 0.85
ShowErrorFunction · 0.85
getProviderDataFunction · 0.85
buildDatabaseDVRFunction · 0.85
removeChildItemsFunction · 0.85
buildXEPGFunction · 0.85
BinaryUpdateFunction · 0.85

Tested by

no test coverage detected