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

Commit

Permalink
Fix EPG mapping does not reflect changes in playlist. Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
SCP002 committed Mar 26, 2022
1 parent b1718ae commit cd5a389
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func createXEPGDatabase() (err error) {
return
}

var generateHashForChannel = func(m3uID string, groupTitle string, tvgID string, tvgName string, uuidKey string, uuidValue string) string {
hash := md5.Sum([]byte(m3uID + groupTitle + tvgID + tvgName + uuidKey + uuidValue))
var generateHashForChannel = func(m3uID string, name string, groupTitle string, tvgID string, tvgName string, uuidKey string, uuidValue string) string {
hash := md5.Sum([]byte(m3uID + name + groupTitle + tvgID + tvgName + uuidKey + uuidValue))
return hex.EncodeToString(hash[:])
}

Expand Down Expand Up @@ -390,7 +390,7 @@ func createXEPGDatabase() (err error) {
if err != nil {
return
}
channelHash := generateHashForChannel(channel.FileM3UID, channel.GroupTitle, channel.TvgID, channel.TvgName, channel.UUIDKey, channel.UUIDValue)
channelHash := generateHashForChannel(channel.FileM3UID, channel.Name, channel.GroupTitle, channel.TvgID, channel.TvgName, channel.UUIDKey, channel.UUIDValue)
xepgChannelsValuesMap[channelHash] = channel
}

Expand All @@ -410,7 +410,7 @@ func createXEPGDatabase() (err error) {
Data.Cache.Streams.Active = append(Data.Cache.Streams.Active, m3uChannel.Name+m3uChannel.FileM3UID)

// Try to find the channel based on matching all known values. If that fails, then move to full channel scan
m3uChannelHash := generateHashForChannel(m3uChannel.FileM3UID, m3uChannel.GroupTitle, m3uChannel.TvgID, m3uChannel.TvgName, m3uChannel.UUIDKey, m3uChannel.UUIDValue)
m3uChannelHash := generateHashForChannel(m3uChannel.FileM3UID, m3uChannel.Name, m3uChannel.GroupTitle, m3uChannel.TvgID, m3uChannel.TvgName, m3uChannel.UUIDKey, m3uChannel.UUIDValue)
if val, ok := xepgChannelsValuesMap[m3uChannelHash]; ok {
channelExists = true
currentXEPGID = val.XEPG
Expand Down

0 comments on commit cd5a389

Please sign in to comment.