Skip to content

Commit

Permalink
Dev (#44)
Browse files Browse the repository at this point in the history
* Fixes #37

* Sync Names with Playlist per playlist (#43)
  • Loading branch information
SenexCrenshaw authored Sep 6, 2022
1 parent d8287b3 commit f3a20ed
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions html/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@
"title": "Starting Channel Number",
"placeholder": "",
"description": ""
},
"syncWithPlaylist": {
"title": "Sync Names with Playlist",
"placeholder": "",
"description": ""
}
},
"playlist": {
Expand Down
1 change: 1 addition & 0 deletions src/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func saveFiles(request RequestStruct, fileType string) (err error) {
filesMap = Settings.Files.M3U
newData = request.Files.M3U
indicator = "M"
reloadData = true

case "hdhr":
filesMap = Settings.Files.HDHR
Expand Down
3 changes: 2 additions & 1 deletion src/struct-webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ type RequestStruct struct {
LogLevel int `json:"logLevelg,omitempty"`

// Upload Logo
Filename string `json:"filename,omitempty"`
Filename string `json:"filename,omitempty"`
SyncWithPlaylist *bool `json:"syncWithPlaylist,omitempty"`

// Filter
Filter map[int64]interface{} `json:"filter,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions src/webUI.go

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/xepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,15 @@ func createXEPGDatabase() (err error) {

// Update Channel Name, only possible with Channel ID's
if channelHasUUID {
if xepgChannel.XUpdateChannelName {
syncWithPlaylistDataConverted := false
syncWithPlaylist := false

m3u := Settings.Files.M3U[m3uChannel.FileM3UID]
if m3u != nil {
syncWithPlaylist, syncWithPlaylistDataConverted = m3u.(map[string]interface{})["syncWithPlaylist"].(bool)
}

if xepgChannel.XUpdateChannelName || (syncWithPlaylist && syncWithPlaylistDataConverted) {
xepgChannel.XName = m3uChannel.Name
}
}
Expand Down Expand Up @@ -477,6 +485,7 @@ func createXEPGDatabase() (err error) {
return getFreeChannelNumber(m3uChannel.StartingChannel)
}
}()

var newChannel XEPGChannelStruct
newChannel.FileM3UID = m3uChannel.FileM3UID
newChannel.FileM3UName = m3uChannel.FileM3UName
Expand Down
4 changes: 4 additions & 0 deletions ts/menu_ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,10 @@ function openPopUp(dataType, element) {
m3uinput.setAttribute("onclick", 'javascript: uploadM3U();')
content.appendRow("{{.playlist.fileM3U.title}}", m3uinput)

var dbKey: string = "syncWithPlaylist"
var input = content.createCheckbox(dbKey)
input.checked = data[dbKey]
content.appendRow("{{.filter.syncWithPlaylist.title}}", input)

// Tuner
if (SERVER["settings"]["buffer"] != "-") {
Expand Down

0 comments on commit f3a20ed

Please # to comment.