Skip to content

Commit

Permalink
v17.0.8
Browse files Browse the repository at this point in the history
- Bugfix on mute feature, it was unmuting on playback recovering
- Fixed a bug which could lead to tuning freeze
- Relevant performance improvements
  • Loading branch information
EdenwareApps committed Jul 28, 2023
1 parent 9d243dc commit 10db2b2
Show file tree
Hide file tree
Showing 32 changed files with 216 additions and 91 deletions.
2 changes: 1 addition & 1 deletion 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="364" id="tv.megacubo.app" version="17.0.7" 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="367" id="tv.megacubo.app" version="17.0.8" 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tv.megacubo.app",
"displayName": "Megacubo",
"version": "17.0.7",
"version": "17.0.8",
"description": "A intuitive and multi-language IPTV player.",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 8 additions & 1 deletion www/nodejs-project/assets/js/index/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class VideoControl extends EventEmitter {
}
const useCurtains = config['fx-nav-intensity']
this.rootElement.removeClass('playing')
if(!this.uiFrame) this.uiFrame = jQuery(document.querySelector('iframe').contentWindow.document.body)
if(!this.uiFrame) {
this.uiFrame = jQuery(document.querySelector('iframe').contentWindow.document.body)
}
this.uiFrame.removeClass('video video-loading video-playing video-paused')
if(useCurtains){
this.rootElement.addClass('curtains-static').removeClass('curtains-alpha').removeClass('curtains').removeClass('curtains-close')
Expand Down Expand Up @@ -143,6 +145,11 @@ class VideoControl extends EventEmitter {
this.current.volume(l)
}
}
muted(){
if(this.current){
return this.current.object.muted
}
}
setState(s, err){
if(this.state != s){
this.state = s
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "جاري الاتصال",
"CONNECTION_FAILURE": "فشل الاتصال",
"CONNECT_TIMEOUT": "انتهاء مهلة الاصتال",
"CONTACT_PROVIDER": "اتصل بمزودك",
"CONTINUE": "استمر",
"CONTROL_PLAYBACK_RATE": "التحكم بمعدل تشغيل وفقًا للمخزن المؤقت",
"CONVERTING": "التحويل...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Anschluss",
"CONNECTION_FAILURE": "Verbindung fehlschlagen",
"CONNECT_TIMEOUT": "Verbindungs Timeout",
"CONTACT_PROVIDER": "Wenden Sie sich an Ihren Anbieter",
"CONTINUE": "Fortsetzen",
"CONTROL_PLAYBACK_RATE": "Steuerungsreproduktionsrate gemäß Puffer",
"CONVERTING": "Konvertieren...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Συνδετικός",
"CONNECTION_FAILURE": "Η σύνδεση αποτυγχάνει",
"CONNECT_TIMEOUT": "Συνδέστε το χρονικό όριο",
"CONTACT_PROVIDER": "Επικοινωνήστε με τον παροχέα σας",
"CONTINUE": "Να συνεχίσει",
"CONTROL_PLAYBACK_RATE": "Ποσοστό αναπαραγωγής ελέγχου σύμφωνα με το buffer",
"CONVERTING": "Μετατροπή...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Connecting",
"CONNECTION_FAILURE": "Connection fail",
"CONNECT_TIMEOUT": "Connect timeout",
"CONTACT_PROVIDER": "Contact your provider",
"CONTINUE": "Continue",
"CONTROL_PLAYBACK_RATE": "Control reproduction rate according to buffer",
"CONVERTING": "Converting...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Conectando",
"CONNECTION_FAILURE": "Conexión fallida",
"CONNECT_TIMEOUT": "Tiempo de espera para conexión",
"CONTACT_PROVIDER": "Póngase en contacto con su proveedor",
"CONTINUE": "Continuar",
"CONTROL_PLAYBACK_RATE": "Tasa de reproducción de control según el búfer",
"CONVERTING": "Convertir...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "De liaison",
"CONNECTION_FAILURE": "Échec de la connexion",
"CONNECT_TIMEOUT": "Connecter le délai d'attente",
"CONTACT_PROVIDER": "Contactez votre fournisseur",
"CONTINUE": "Continuez",
"CONTROL_PLAYBACK_RATE": "Taux de reproduction de contrôle en fonction de la mémoire tampon",
"CONVERTING": "Conversion...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "कनेक्ट",
"CONNECTION_FAILURE": "संबंध विफल",
"CONNECT_TIMEOUT": "टाइमआउट कनेक्ट करें",
"CONTACT_PROVIDER": "अपने प्रदाता से संपर्क करें",
"CONTINUE": "जारी रखें",
"CONTROL_PLAYBACK_RATE": "बफर के अनुसार नियंत्रण प्रजनन दर",
"CONVERTING": "परिवर्तित...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Connessione in corso",
"CONNECTION_FAILURE": "Connessione fallimento",
"CONNECT_TIMEOUT": "Timeout connessione",
"CONTACT_PROVIDER": "Contatta il tuo provider",
"CONTINUE": "Continua",
"CONTROL_PLAYBACK_RATE": "Controllare la velocità di riproduzione in base al buffer",
"CONVERTING": "Convertire...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Złączony",
"CONNECTION_FAILURE": "Połączenie awarii",
"CONNECT_TIMEOUT": "Connect timeout",
"CONTACT_PROVIDER": "Skontaktuj się z dostawcą",
"CONTINUE": "Kontyntynuj",
"CONTROL_PLAYBACK_RATE": "Sterowanie reprodukcją w zależności od bufora",
"CONVERTING": "Przekształcenie...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Conectando",
"CONNECTION_FAILURE": "Falha na conexão",
"CONNECT_TIMEOUT": "Tempo limite para conexão",
"CONTACT_PROVIDER": "Contate seu provedor",
"CONTINUE": "Continue",
"CONTROL_PLAYBACK_RATE": "Controlar taxa de reprodução de acordo com o buffer",
"CONVERTING": "Convertendo...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Соединение",
"CONNECTION_FAILURE": "Сбой соединения",
"CONNECT_TIMEOUT": "Подключите тайм-аут",
"CONTACT_PROVIDER": "Свяжитесь с вашим провайдером",
"CONTINUE": "Продолжать",
"CONTROL_PLAYBACK_RATE": "Уровень воспроизведения контроля в соответствии с буфером",
"CONVERTING": "Конвертирование...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/sq.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Lidh",
"CONNECTION_FAILURE": "Lidhja dështon",
"CONNECT_TIMEOUT": "Lidhni timout",
"CONTACT_PROVIDER": "Kontaktoni me ofruesin tuaj",
"CONTINUE": "Vazhdoj",
"CONTROL_PLAYBACK_RATE": "Norma e riprodhimit të kontrollit sipas tamponit",
"CONVERTING": "Duke u kthyer...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "Bağlanıyor",
"CONNECTION_FAILURE": "Bağlantı başarısız",
"CONNECT_TIMEOUT": "Bağlantı zaman aşımı",
"CONTACT_PROVIDER": "Sağlayıcınızla iletişime geçin",
"CONTINUE": "Devam et",
"CONTROL_PLAYBACK_RATE": "Tampona göre reprodüksiyon oranını kontrol edin",
"CONVERTING": "Dönüştürme...",
Expand Down
1 change: 1 addition & 0 deletions www/nodejs-project/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"CONNECTING": "连接",
"CONNECTION_FAILURE": "连接失败",
"CONNECT_TIMEOUT": "限制时间连接",
"CONTACT_PROVIDER": "联系您的提供商",
"CONTINUE": "继续",
"CONTROL_PLAYBACK_RATE": "根据缓冲区控制播放率",
"CONVERTING": "转换...",
Expand Down
8 changes: 6 additions & 2 deletions www/nodejs-project/modules/channels/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,15 @@ class ChannelsEPG extends ChannelsCategories {
}, async data => {
const name = data.originalName || data.name
const category = this.getChannelCategory(name)
if(category){
if(!global.activeEPG) {
global.displayErr(global.lang.EPG_DISABLED)
} else if(!this.loadedEPG) {
global.displayErr(global.lang.EPG_AVAILABLE_SOON)
} else if(category) {
let err
await this.epgChannelLiveNow(data).catch(e => {
err = e
global.displayErr(global.lang.CHANNEL_EPG_NOT_FOUND)
global.displayErr(global.lang.CHANNEL_EPG_NOT_FOUND +' *')
})
if(!err) {
const _path = [global.lang.LIVE, category, name, global.lang.EPG].join('/')
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/download/download-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DownloadCacheFileReader extends Events {
}
destroy(){
this.removeAllListeners()
this.stream && this.stream.destroy()
this.stream && this.stream.close()
}
}

Expand Down
63 changes: 47 additions & 16 deletions www/nodejs-project/modules/lists/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,26 +346,35 @@ class Index extends Common {
}
intersectMap(a, b){
let c = {}
Object.keys(b).forEach(listUrl => {
for(const listUrl in b) {
if(typeof(a[listUrl]) != 'undefined'){
const gset = new Set(
a[listUrl].g.length && b[listUrl].g.length ?
b[listUrl].g : []
)
const nset = new Set(
a[listUrl].n.length && b[listUrl].n.length ?
b[listUrl].n : []
)
c[listUrl] = {
g: a[listUrl].g ? a[listUrl].g.filter(n => b[listUrl].g.includes(n)).sort((a, b) => a - b) : [],
n: a[listUrl].n ? a[listUrl].n.filter(n => b[listUrl].n.includes(n)).sort((a, b) => a - b) : []
g: gset.size ? a[listUrl].g.filter(n => gset.has(n)) : [],
n: nset.size ? a[listUrl].n.filter(n => nset.has(n)) : []
}
}
})
}
return c
}
joinMap(a, b){
let c = this.cloneMap(a) // clone it
Object.keys(b).forEach(listUrl => {
for(const listUrl in b) {
if(typeof(c[listUrl]) == 'undefined'){
c[listUrl] = {g: [], n: []}
}
Object.keys(b[listUrl]).forEach(type => {
for(const type in b[listUrl]) {
let changed
const map = new Set(c[listUrl][type] || [])
b[listUrl][type].forEach(n => {
if(!c[listUrl][type].includes(n)){
if(!map.has(n)){
c[listUrl][type].push(n)
if(!changed){
changed = true
Expand All @@ -375,29 +384,51 @@ class Index extends Common {
if(changed){
c[listUrl][type].sort((a, b) => a - b)
}
})
})
}
}
return c
}
diffMap(a, b){
_diffMap(a, b){
let c
Object.keys(b).forEach(listUrl => {
if(typeof(a[listUrl]) != 'undefined'){
Object.keys(b[listUrl]).forEach(type => {
for(const listUrl in b) {
if(typeof(a[listUrl]) != 'undefined') {
for(const type in b[listUrl]) {
if(typeof(a[listUrl][type]) != 'undefined'){
const map = new Set(c ? c[listUrl][type] : a[listUrl][type])
b[listUrl][type].forEach(n => {
let i = c ? c[listUrl][type].indexOf(n) : a[listUrl][type].indexOf(n)
if(i != -1){
if(map.has(n)){
if(!c) c = this.cloneMap(a) // clone it lazily
c[listUrl][type].splice(i, 1)
}
})
}
})
}
}
})
}
return c || a
}
diffMap(a, b) {
let c = {}
for (const listUrl in b) {
if (a[listUrl] !== undefined) {
c[listUrl] = {g: [], n: []}
const gSet = new Set(a[listUrl].g)
const nSet = new Set(a[listUrl].n)
for (const type in b[listUrl]) {
if (a[listUrl][type] !== undefined) {
const diffSet = new Set(b[listUrl][type])
if (type === 'g') {
c[listUrl].g = [...gSet].filter(n => !diffSet.has(n))
} else {
c[listUrl].n = [...nSet].filter(n => !diffSet.has(n))
}
}
}
}
}
return c
}
cloneMap(a){
return global.deepClone(a)
}
Expand Down
23 changes: 19 additions & 4 deletions www/nodejs-project/modules/lists/list-index-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ListIndexUtils extends Events {
})
}
async readLastLine() {
const bufferSize = 2048
const bufferSize = 16834
const { size } = await fs.promises.stat(this.file)
const fd = await fs.promises.open(this.file, 'r')
let line = ''
Expand Down Expand Up @@ -143,14 +143,29 @@ class ListIndexUtils extends Events {
let index = false
if(line){
try {
index = global.parseJSON(line)
let parsed = global.parseJSON(line)
if(Array.isArray(parsed)) {
this.linesMap = parsed
const fd = await fs.promises.open(this.file, 'r')
const from = parsed[parsed.length - 2]
const length = parsed[parsed.length - 1] - from
const buffer = Buffer.alloc(length)
const { bytesRead } = await fd.read(buffer, 0, length, from)
await fd.close().catch(console.error)
line = String(buffer).substr(0, bytesRead)
index = JSON.parse(line)
} else {
index = parsed // old style compat
}
} catch(e) {
console.error('Index parsing failure', line, e, this.file)
}
}
if(index && typeof(index.length) != 'undefined'){
this.linesMap = index.linesMap
delete index.linesMap
if(index.linesMap) {
this.linesMap = index.linesMap
delete index.linesMap
}
return index
} else {
console.error('Bad index', String(line).substr(0, 256), this.file)
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/lists/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ class Lists extends ListsEPGTools {
})
return dup
}
isExpiredList(list){
isExpiredList(list){ // check if links are all pointing to some few URLs
if(!list || !list.index || this.myLists.includes(list.url)){
return
}
Expand Down
7 changes: 4 additions & 3 deletions www/nodejs-project/modules/lists/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ class ListsLoader extends Events {
if(p.progressId == uid) progress(p.progress)
})
await this.updater.update(url, false, uid).catch(console.error)
this.updater && this.updater.close()
this.master.addList(url, 1)
this.updater.close()
}
schedule(url, priority){
schedule(url, priority){
let cancel, started, done
this.processes.some(p => p.url == url) || this.processes.push({
promise: this.queue.add(async () => {
Expand All @@ -171,10 +171,10 @@ class ListsLoader extends Events {
await this.prepareUpdater()
this.results[url] = 'awaiting'
this.results[url] = await this.updater.update(url).catch(console.error)
this.updater && this.updater.close()
done = true
const add = this.results[url] == 'updated' || (this.results[url] == 'already updated' && !this.master.processedLists.has(url))
add && this.master.addList(url, priority)
this.updater.close()
}, { priority }),
started: () => {
return started
Expand All @@ -190,6 +190,7 @@ class ListsLoader extends Events {
await this.prepareUpdater()
this.results[url] = 'reloading'
this.results[url] = await this.updater.updateList(url, true).catch(err => updateErr = err)
this.updater && this.updater.close()
if(updateErr) throw updateErr
await this.master.loadList(url).catch(err => updateErr = err)
if(updateErr) throw updateErr
Expand Down
Loading

0 comments on commit 10db2b2

Please sign in to comment.