Skip to content

Commit

Permalink
v17.4.3
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
EdenwareApps committed Feb 16, 2024
1 parent c1d1da1 commit 8bb718b
Show file tree
Hide file tree
Showing 13 changed files with 208 additions and 142 deletions.
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<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">
<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">
<name>Megacubo</name>
<description>
An intuitive, free and open source IPTV player.
Expand Down Expand Up @@ -65,7 +65,7 @@
<preference name="AndroidXEnabled" value="true" />
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/android/icon/drawable-xxxhdpi-icon.png" />
<preference name="AndroidWindowSplashScreenBackground" value="#362064" />
<preference name="OverrideUserAgent" value="Megacubo 17.4.2" />
<preference name="OverrideUserAgent" value="Megacubo 17.4.3" />
<icon src="resources/android/icon/drawable-ldpi-icon.png" />
<icon background="@color/background" density="ldpi" foreground="resources/android/icon/ldpi-foreground.png" qualifier="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon background="@color/background" density="mdpi" foreground="resources/android/icon/mdpi-foreground.png" qualifier="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "megacubo",
"displayName": "Megacubo",
"version": "17.4.2",
"version": "17.4.3",
"description": "A intuitive and multi-language IPTV player.",
"repository": {
"type": "git",
Expand Down
254 changes: 154 additions & 100 deletions www/nodejs-project/modules/channels/channels.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ class CommunityLists {
fa: 'fas fa-satellite-dish',
type: 'group',
class: 'skip-testing',
renderer: global.lists.directListRenderer.bind(global.lists)
renderer: global.lists.manager.directListRenderer.bind(global.lists.manager)
}
}).filter(l => l)
if(!entries.length){
if(!global.lists.loaded()){
entries = [global.lists.updatingListsEntry()]
entries = [global.lists.manager.updatingListsEntry()]
} else {
entries = [global.lists.noListsRetryEntry()]
entries = [global.lists.manager.noListsRetryEntry()]
}
}
return entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ class PublicLists extends Events {
}))
}
}
async entries(){
async entries(local){
await this.ready()
let entries = Object.keys(this.data).map(countryCode => {
let entries = Object.keys(this.data)
if(local === true) {
let locs = await global.lang.getActiveCountries(0).catch(console.error)
entries = entries.filter(e => locs.includes(e))
}
entries = entries.map(countryCode => {
return {
name: this.countries.getCountryName(countryCode, global.lang.locale),
type: 'group',
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/lists/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Common extends Events {
this.sanitizeName = sanitizeName
this.Fetcher = Fetcher
this.searchRedirects = []
this.stopWords = ['sd', 'hd', 'h264', 'h.264', 'fhd'] // common words to ignore on searching
this.stopWords = ['sd', '4k', 'hd', 'h264', 'h.264', 'fhd', 'uhd'] // common words to ignore on searching
this.listMetaKeyPrefix = 'meta-cache-'
this.opts = {
defaultCommunityModeReach: 12,
Expand Down
8 changes: 6 additions & 2 deletions www/nodejs-project/modules/lists/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Index extends Common {
aterms.push(term)
}
})
let needles = aterms.join(' ').split(' | ').map(s => s.split(' '))
const needles = aterms.join(' ').split(' | ').map(s => s.replaceAll('|', '').split(' '))
return {
excludes,
queries: needles.map(nterms => {
Expand Down Expand Up @@ -450,9 +450,13 @@ class Index extends Common {
cloneMap(a){
return global.deepClone(a)
}
async groups(types){
async groups(types, myListsOnly){
let groups = [], map = {}
if(myListsOnly) {
myListsOnly = global.config.get('lists').map(l => l[1])
}
Object.keys(this.lists).forEach(url => {
if(myListsOnly && !myListsOnly.includes(url)) return
let entries = this.lists[url].index.groupsTypes
types.forEach(type => {
if(!entries || !entries[type]) return
Expand Down
6 changes: 3 additions & 3 deletions www/nodejs-project/modules/lists/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ListsEPGTools extends Index {
let currentScore = this.epgChannelsListSanityScore(data['categories'])
const limit = pLimit(3)
const tasks = Object.keys(this.lists).filter(url => {
return this.lists[url].index.meta['epg'].indexOf(this._epg.url) != -1 // use indexOf as it can be a comma delimited list
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
}).map(url => {
return async () => {
let categories = {}
Expand Down Expand Up @@ -825,7 +825,7 @@ class Lists extends ListsEPGTools {
}
const cachettl = 3600, now = global.time(), olen = list.length
if(typeof(this.directListRendererPrepareCache[url]) != 'undefined' && this.directListRendererPrepareCache[url].size == olen && this.directListRendererPrepareCache[url].time > (now - cachettl)){
return this.directListRendererPrepareCache[url].list
return this.directListRendererPrepareCache[url].list.slice(0) // clone it
}
if(list.length){
list = this.parentalControl.filter(list, true)
Expand All @@ -835,7 +835,7 @@ class Lists extends ListsEPGTools {
if(olen >= this.opts.offloadThreshold){
this.directListRendererPrepareCache[url] = {list, time: now, size: olen}
}
return list
return list.slice(0) // clone it to not alter cache
}
isLocal(file){
if(typeof(file) != 'string'){
Expand Down
5 changes: 3 additions & 2 deletions www/nodejs-project/modules/lists/update-list-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class UpdateListIndex extends ListIndexUtils {
this.contentLength = this.stream.totalContentLength
}
if(this.stream.totalContentLength > 0 && (this.stream.totalContentLength == this.updateMeta.contentLength)){
console.log('UpdateListIndex fetch skipped')
this.stream.destroy()
resolve(false) // no need to update
} else {
Expand All @@ -123,7 +124,7 @@ class UpdateListIndex extends ListIndexUtils {
})
this.stream.on('end', () => {
if(this.debug){
console.log('end')
console.log('UpdateListIndex fetch end')
}
this.stream && this.stream.destroy()
if(!resolved) {
Expand All @@ -132,7 +133,7 @@ class UpdateListIndex extends ListIndexUtils {
}
})
this.stream.on('error', e => {
if(this.debug) console.log('err', e)
console.error('UpdateListIndex fetch err', e)
})
this.stream.start()
} else {
Expand Down
48 changes: 25 additions & 23 deletions www/nodejs-project/modules/omni/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class OMNI extends OMNIUtils {
eventHandler(evt){
if(!this.validateEvent(evt)) return
if(evt.target && evt.target != this.rinput){
if(evt.key && evt.key.length == 1 && evt.key != ' '){
if(evt.key && evt.key.length == 1 && evt.key != ' ') {
this.defaultValue = evt.key
if(explorer.inPlayer() && !explorer.isExploring()) {
menuPlaying(true, true)
Expand All @@ -168,33 +168,35 @@ class OMNI extends OMNIUtils {
if(this.typing){
if(this.type != 'numeric' && this.typing.length == 1){
let lc = this.typing.toLowerCase(), pos = -1
explorer.currentEntries.some((n, i) => {
if(n.type == 'back') return
if(n.name.charAt(0).toLowerCase() == lc){
pos = i
return true
}
})
if(pos < 0){
if(lc != '.' && lc != '*') {
explorer.currentEntries.some((n, i) => {
if(n.type == 'back') return
if(n.name.charAt(0).toLowerCase() < lc){
if(n.type == 'back') return
if(n.name.charAt(0).toLowerCase() == lc){
pos = i
} else {
return true
}
return true
}
})
if(pos < 0){
explorer.currentEntries.some((n, i) => {
if(n.type == 'back') return
if(n.name.charAt(0).toLowerCase() < lc){
pos = i
} else {
return true
}
})
}
if(pos < 0){
pos = explorer.currentEntries.length - 1
}
if(pos > 0){
explorer.focus(explorer.currentElements[pos])
}
return
}
if(pos < 0){
pos = explorer.currentEntries.length - 1
}
if(pos > 0){
explorer.focus(explorer.currentElements[pos])
}
} else {
app.emit('omni', this.typing, this.type)
this.updateIcon('fas fa-circle-notch fa-spin')
}
app.emit('omni', this.typing, this.type)
this.updateIcon('fas fa-circle-notch fa-spin')
}
}
}
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/omni/omni.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OMNI extends Events {
return global.streamer.play(entry)
}
}
}
}
global.channels.search(text, true).then(results => {
if(results.length){
global.search.go(text, 'live')
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Search extends Events {
const rs = await this[mediaType == 'live' ? 'channelsResults' : 'results'](value).catch(e => err = e)
global.osd.hide('search')
if(Array.isArray(rs)){
console.log('results', rs)
console.log('results', rs.length)
if(!rs.length && mediaType == 'live'){
return this.go(value, 'all')
}
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"url": "https://megacubo.tv"
},
"icon": "./default_icon.png",
"version": "17.4.2",
"version": "17.4.3",
"theme": {
"fullScreen": true
},
Expand Down

0 comments on commit 8bb718b

Please sign in to comment.