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

Commit 60a755a

Browse files
committed
Remove unfiltered channel limit. Closes #14
1 parent 30dad33 commit 60a755a

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

src/config.go

-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func Init() (err error) {
4747
System.ServerProtocol.WEB = "http"
4848
System.ServerProtocol.XML = "http"
4949
System.PlexChannelLimit = 480
50-
System.UnfilteredChannelLimit = 480
5150
System.Compatibility = "1.4.4"
5251

5352
// FFmpeg Default Settings
@@ -228,7 +227,6 @@ func StartSystem(updateProviderFiles bool) (err error) {
228227
showInfo(fmt.Sprintf("Tuner (Plex / Emby):%d", Settings.Tuner))
229228
showInfo(fmt.Sprintf("EPG Source:%s", Settings.EpgSource))
230229
showInfo(fmt.Sprintf("Plex Channel Limit:%d", System.PlexChannelLimit))
231-
showInfo(fmt.Sprintf("Unfiltered Chan. Limit:%d", System.UnfilteredChannelLimit))
232230

233231
// Update Provider Data
234232
if len(Settings.Files.M3U) > 0 && Settings.FilesUpdate == true || updateProviderFiles == true {

src/data.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,9 @@ func buildDatabaseDVR() (err error) {
790790

791791
System.ScanInProgress = 1
792792

793-
Data.Streams.All = make([]interface{}, 0, System.UnfilteredChannelLimit)
794-
Data.Streams.Active = make([]interface{}, 0, System.UnfilteredChannelLimit)
795-
Data.Streams.Inactive = make([]interface{}, 0, System.UnfilteredChannelLimit)
793+
Data.Streams.All = make([]interface{}, 0)
794+
Data.Streams.Active = make([]interface{}, 0)
795+
Data.Streams.Inactive = make([]interface{}, 0)
796796
Data.Playlist.M3U.Groups.Text = []string{}
797797
Data.Playlist.M3U.Groups.Value = []string{}
798798
Data.StreamPreviewUI.Active = []string{}
@@ -948,7 +948,7 @@ func buildDatabaseDVR() (err error) {
948948
sort.Strings(Data.Playlist.M3U.Groups.Text)
949949
sort.Strings(Data.Playlist.M3U.Groups.Value)
950950

951-
if len(Data.Streams.Active) == 0 && len(Data.Streams.All) <= System.UnfilteredChannelLimit && len(Settings.Filter) == 0 {
951+
if len(Data.Streams.Active) == 0 && len(Settings.Filter) == 0 {
952952
Data.Streams.Active = Data.Streams.All
953953
Data.Streams.Inactive = make([]interface{}, 0)
954954

@@ -961,10 +961,6 @@ func buildDatabaseDVR() (err error) {
961961
showWarning(2000)
962962
}
963963

964-
if len(Settings.Filter) == 0 && len(Data.Streams.All) > System.UnfilteredChannelLimit {
965-
showWarning(2001)
966-
}
967-
968964
System.ScanInProgress = 0
969965
showInfo(fmt.Sprintf("All streams:%d", len(Data.Streams.All)))
970966
showInfo(fmt.Sprintf("Active streams:%d", len(Data.Streams.Active)))

src/screen.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,11 @@ func getErrMsg(errCode int) (errMsg string) {
306306

307307
// Warnings
308308
case 2000:
309-
errMsg = fmt.Sprintf("Plex can not handle more than %d streams. If you do not use Plex, you can ignore this warning.", System.PlexChannelLimit)
309+
errMsg = fmt.Sprintf("Plex can not handle more than %d streams. Use filter to reduce the number of streams. "+
310+
"If you do not use Plex, ignore this warning.", System.PlexChannelLimit)
310311
case 2001:
311-
errMsg = fmt.Sprintf("%s has loaded more than %d streams. Use the filter to reduce the number of streams.", System.Name, System.UnfilteredChannelLimit)
312+
// Free slot
313+
return
312314
case 2002:
313315
errMsg = fmt.Sprintf("PMS can not play m3u8 streams")
314316
case 2003:

src/struct-system.go

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ type SystemStruct struct {
2323
DeviceID string
2424
Domain string
2525
PlexChannelLimit int
26-
UnfilteredChannelLimit int
2726

2827
FFmpeg struct {
2928
DefaultOptions string

src/xepg.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ func createXEPGMapping() {
248248
// Create / update XEPG Database
249249
func createXEPGDatabase() (err error) {
250250

251-
var allChannelNumbers = make([]float64, 0, System.UnfilteredChannelLimit)
252-
Data.Cache.Streams.Active = make([]string, 0, System.UnfilteredChannelLimit)
253-
Data.XEPG.Channels = make(map[string]interface{}, System.UnfilteredChannelLimit)
251+
var allChannelNumbers = make([]float64, 0)
252+
Data.Cache.Streams.Active = make([]string, 0)
253+
Data.XEPG.Channels = make(map[string]interface{})
254254

255255
Data.XEPG.Channels, err = loadJSONFileToMap(System.File.XEPG)
256256
if err != nil {
@@ -327,7 +327,7 @@ func createXEPGDatabase() (err error) {
327327
}
328328

329329
// Make a map of the db channels based on their previously downloaded attributes -- filename, group, title, etc
330-
var xepgChannelsValuesMap = make(map[string]XEPGChannelStruct, System.UnfilteredChannelLimit)
330+
var xepgChannelsValuesMap = make(map[string]XEPGChannelStruct)
331331
for _, v := range Data.XEPG.Channels {
332332
var channel XEPGChannelStruct
333333
err = json.Unmarshal([]byte(mapToJSON(v)), &channel)

0 commit comments

Comments
 (0)