Lokale Provider XMLTV Datei laden
(file string, xmltv *XMLTV)
| 1713 | |
| 1714 | // Lokale Provider XMLTV Datei laden |
| 1715 | func getLocalXMLTV(file string, xmltv *XMLTV) (err error) { |
| 1716 | |
| 1717 | if _, ok := Data.Cache.XMLTV[file]; !ok { |
| 1718 | |
| 1719 | // Cache initialisieren |
| 1720 | if len(Data.Cache.XMLTV) == 0 { |
| 1721 | Data.Cache.XMLTV = make(map[string]XMLTV) |
| 1722 | } |
| 1723 | |
| 1724 | // XML Daten lesen |
| 1725 | content, err := readByteFromFile(file) |
| 1726 | |
| 1727 | // Lokale XML Datei existiert nicht im Ordner: data |
| 1728 | if err != nil { |
| 1729 | err = errors.New("Local copy of the file no longer exists") |
| 1730 | return err |
| 1731 | } |
| 1732 | |
| 1733 | // XML Datei parsen |
| 1734 | err = xml.Unmarshal(content, &xmltv) |
| 1735 | if err != nil { |
| 1736 | return err |
| 1737 | } |
| 1738 | |
| 1739 | Data.Cache.XMLTV[file] = *xmltv |
| 1740 | |
| 1741 | } else { |
| 1742 | *xmltv = Data.Cache.XMLTV[file] |
| 1743 | } |
| 1744 | |
| 1745 | return |
| 1746 | } |
| 1747 | |
| 1748 | func isInInactiveList(channelURL string) bool { |
| 1749 | for _, channel := range Data.Streams.Inactive { |
no test coverage detected