Skip to content

Commit 8bb718b

Browse files
committed
v17.4.3
- The automatic selection of the channel list in the "Live" section is now more dynamic. - List all channels at once by just typing * or "." in search.
1 parent c1d1da1 commit 8bb718b

File tree

13 files changed

+208
-142
lines changed

13 files changed

+208
-142
lines changed

config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget android-versionCode="456" id="tv.megacubo.app" version="17.4.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget android-versionCode="456" id="tv.megacubo.app" version="17.4.3" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>Megacubo</name>
44
<description>
55
An intuitive, free and open source IPTV player.
@@ -65,7 +65,7 @@
6565
<preference name="AndroidXEnabled" value="true" />
6666
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/android/icon/drawable-xxxhdpi-icon.png" />
6767
<preference name="AndroidWindowSplashScreenBackground" value="#362064" />
68-
<preference name="OverrideUserAgent" value="Megacubo 17.4.2" />
68+
<preference name="OverrideUserAgent" value="Megacubo 17.4.3" />
6969
<icon src="resources/android/icon/drawable-ldpi-icon.png" />
7070
<icon background="@color/background" density="ldpi" foreground="resources/android/icon/ldpi-foreground.png" qualifier="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
7171
<icon background="@color/background" density="mdpi" foreground="resources/android/icon/mdpi-foreground.png" qualifier="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "megacubo",
33
"displayName": "Megacubo",
4-
"version": "17.4.2",
4+
"version": "17.4.3",
55
"description": "A intuitive and multi-language IPTV player.",
66
"repository": {
77
"type": "git",

www/nodejs-project/modules/channels/channels.js

Lines changed: 154 additions & 100 deletions
Large diffs are not rendered by default.

www/nodejs-project/modules/discovery/providers/community-lists.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ class CommunityLists {
6969
fa: 'fas fa-satellite-dish',
7070
type: 'group',
7171
class: 'skip-testing',
72-
renderer: global.lists.directListRenderer.bind(global.lists)
72+
renderer: global.lists.manager.directListRenderer.bind(global.lists.manager)
7373
}
7474
}).filter(l => l)
7575
if(!entries.length){
7676
if(!global.lists.loaded()){
77-
entries = [global.lists.updatingListsEntry()]
77+
entries = [global.lists.manager.updatingListsEntry()]
7878
} else {
79-
entries = [global.lists.noListsRetryEntry()]
79+
entries = [global.lists.manager.noListsRetryEntry()]
8080
}
8181
}
8282
return entries

www/nodejs-project/modules/discovery/providers/public-lists.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ class PublicLists extends Events {
4646
}))
4747
}
4848
}
49-
async entries(){
49+
async entries(local){
5050
await this.ready()
51-
let entries = Object.keys(this.data).map(countryCode => {
51+
let entries = Object.keys(this.data)
52+
if(local === true) {
53+
let locs = await global.lang.getActiveCountries(0).catch(console.error)
54+
entries = entries.filter(e => locs.includes(e))
55+
}
56+
entries = entries.map(countryCode => {
5257
return {
5358
name: this.countries.getCountryName(countryCode, global.lang.locale),
5459
type: 'group',

www/nodejs-project/modules/lists/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Common extends Events {
9393
this.sanitizeName = sanitizeName
9494
this.Fetcher = Fetcher
9595
this.searchRedirects = []
96-
this.stopWords = ['sd', 'hd', 'h264', 'h.264', 'fhd'] // common words to ignore on searching
96+
this.stopWords = ['sd', '4k', 'hd', 'h264', 'h.264', 'fhd', 'uhd'] // common words to ignore on searching
9797
this.listMetaKeyPrefix = 'meta-cache-'
9898
this.opts = {
9999
defaultCommunityModeReach: 12,

www/nodejs-project/modules/lists/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Index extends Common {
6363
aterms.push(term)
6464
}
6565
})
66-
let needles = aterms.join(' ').split(' | ').map(s => s.split(' '))
66+
const needles = aterms.join(' ').split(' | ').map(s => s.replaceAll('|', '').split(' '))
6767
return {
6868
excludes,
6969
queries: needles.map(nterms => {
@@ -450,9 +450,13 @@ class Index extends Common {
450450
cloneMap(a){
451451
return global.deepClone(a)
452452
}
453-
async groups(types){
453+
async groups(types, myListsOnly){
454454
let groups = [], map = {}
455+
if(myListsOnly) {
456+
myListsOnly = global.config.get('lists').map(l => l[1])
457+
}
455458
Object.keys(this.lists).forEach(url => {
459+
if(myListsOnly && !myListsOnly.includes(url)) return
456460
let entries = this.lists[url].index.groupsTypes
457461
types.forEach(type => {
458462
if(!entries || !entries[type]) return

www/nodejs-project/modules/lists/lists.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class ListsEPGTools extends Index {
110110
let currentScore = this.epgChannelsListSanityScore(data['categories'])
111111
const limit = pLimit(3)
112112
const tasks = Object.keys(this.lists).filter(url => {
113-
return this.lists[url].index.meta['epg'].indexOf(this._epg.url) != -1 // use indexOf as it can be a comma delimited list
113+
return this.lists[url].index.meta['epg'] && this.lists[url].index.meta['epg'].indexOf(this._epg.url) != -1 // use indexOf as it can be a comma delimited list
114114
}).map(url => {
115115
return async () => {
116116
let categories = {}
@@ -825,7 +825,7 @@ class Lists extends ListsEPGTools {
825825
}
826826
const cachettl = 3600, now = global.time(), olen = list.length
827827
if(typeof(this.directListRendererPrepareCache[url]) != 'undefined' && this.directListRendererPrepareCache[url].size == olen && this.directListRendererPrepareCache[url].time > (now - cachettl)){
828-
return this.directListRendererPrepareCache[url].list
828+
return this.directListRendererPrepareCache[url].list.slice(0) // clone it
829829
}
830830
if(list.length){
831831
list = this.parentalControl.filter(list, true)
@@ -835,7 +835,7 @@ class Lists extends ListsEPGTools {
835835
if(olen >= this.opts.offloadThreshold){
836836
this.directListRendererPrepareCache[url] = {list, time: now, size: olen}
837837
}
838-
return list
838+
return list.slice(0) // clone it to not alter cache
839839
}
840840
isLocal(file){
841841
if(typeof(file) != 'string'){

www/nodejs-project/modules/lists/update-list-index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class UpdateListIndex extends ListIndexUtils {
107107
this.contentLength = this.stream.totalContentLength
108108
}
109109
if(this.stream.totalContentLength > 0 && (this.stream.totalContentLength == this.updateMeta.contentLength)){
110+
console.log('UpdateListIndex fetch skipped')
110111
this.stream.destroy()
111112
resolve(false) // no need to update
112113
} else {
@@ -123,7 +124,7 @@ class UpdateListIndex extends ListIndexUtils {
123124
})
124125
this.stream.on('end', () => {
125126
if(this.debug){
126-
console.log('end')
127+
console.log('UpdateListIndex fetch end')
127128
}
128129
this.stream && this.stream.destroy()
129130
if(!resolved) {
@@ -132,7 +133,7 @@ class UpdateListIndex extends ListIndexUtils {
132133
}
133134
})
134135
this.stream.on('error', e => {
135-
if(this.debug) console.log('err', e)
136+
console.error('UpdateListIndex fetch err', e)
136137
})
137138
this.stream.start()
138139
} else {

www/nodejs-project/modules/omni/client.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class OMNI extends OMNIUtils {
151151
eventHandler(evt){
152152
if(!this.validateEvent(evt)) return
153153
if(evt.target && evt.target != this.rinput){
154-
if(evt.key && evt.key.length == 1 && evt.key != ' '){
154+
if(evt.key && evt.key.length == 1 && evt.key != ' ') {
155155
this.defaultValue = evt.key
156156
if(explorer.inPlayer() && !explorer.isExploring()) {
157157
menuPlaying(true, true)
@@ -168,33 +168,35 @@ class OMNI extends OMNIUtils {
168168
if(this.typing){
169169
if(this.type != 'numeric' && this.typing.length == 1){
170170
let lc = this.typing.toLowerCase(), pos = -1
171-
explorer.currentEntries.some((n, i) => {
172-
if(n.type == 'back') return
173-
if(n.name.charAt(0).toLowerCase() == lc){
174-
pos = i
175-
return true
176-
}
177-
})
178-
if(pos < 0){
171+
if(lc != '.' && lc != '*') {
179172
explorer.currentEntries.some((n, i) => {
180-
if(n.type == 'back') return
181-
if(n.name.charAt(0).toLowerCase() < lc){
173+
if(n.type == 'back') return
174+
if(n.name.charAt(0).toLowerCase() == lc){
182175
pos = i
183-
} else {
184-
return true
185-
}
176+
return true
177+
}
186178
})
179+
if(pos < 0){
180+
explorer.currentEntries.some((n, i) => {
181+
if(n.type == 'back') return
182+
if(n.name.charAt(0).toLowerCase() < lc){
183+
pos = i
184+
} else {
185+
return true
186+
}
187+
})
188+
}
189+
if(pos < 0){
190+
pos = explorer.currentEntries.length - 1
191+
}
192+
if(pos > 0){
193+
explorer.focus(explorer.currentElements[pos])
194+
}
195+
return
187196
}
188-
if(pos < 0){
189-
pos = explorer.currentEntries.length - 1
190-
}
191-
if(pos > 0){
192-
explorer.focus(explorer.currentElements[pos])
193-
}
194-
} else {
195-
app.emit('omni', this.typing, this.type)
196-
this.updateIcon('fas fa-circle-notch fa-spin')
197197
}
198+
app.emit('omni', this.typing, this.type)
199+
this.updateIcon('fas fa-circle-notch fa-spin')
198200
}
199201
}
200202
}

www/nodejs-project/modules/omni/omni.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class OMNI extends Events {
2121
return global.streamer.play(entry)
2222
}
2323
}
24-
}
24+
}
2525
global.channels.search(text, true).then(results => {
2626
if(results.length){
2727
global.search.go(text, 'live')

www/nodejs-project/modules/search/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class Search extends Events {
9292
const rs = await this[mediaType == 'live' ? 'channelsResults' : 'results'](value).catch(e => err = e)
9393
global.osd.hide('search')
9494
if(Array.isArray(rs)){
95-
console.log('results', rs)
95+
console.log('results', rs.length)
9696
if(!rs.length && mediaType == 'live'){
9797
return this.go(value, 'all')
9898
}

www/nodejs-project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"url": "https://megacubo.tv"
6060
},
6161
"icon": "./default_icon.png",
62-
"version": "17.4.2",
62+
"version": "17.4.3",
6363
"theme": {
6464
"fullScreen": true
6565
},

0 commit comments

Comments
 (0)