Skip to content

Commit

Permalink
v17.1.2
Browse files Browse the repository at this point in the history
- Minor bugfixes and improvements
  • Loading branch information
EdenwareApps committed Aug 3, 2023
1 parent 5d3fac7 commit 1c86ccd
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 40 deletions.
3 changes: 2 additions & 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="376" id="tv.megacubo.app" version="17.1.1" 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="376" id="tv.megacubo.app" version="17.1.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">
<name>Megacubo</name>
<description>
An intuitive, free and open source IPTV player.
Expand Down Expand Up @@ -55,6 +55,7 @@
<preference name="loadUrlTimeoutValue" value="300000" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="MixedContentMode" value="0" />
<preference name="Scheme" value="http" />
<preference name="ResolveServiceWorkerRequests" value="false" />
<preference name="resizeOnFullScreen" value="false" />
<preference name="CustomURLSchemePluginClearsAndroidIntent" value="true" />
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.1.1",
"version": "17.1.2",
"description": "A intuitive and multi-language IPTV player.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/electron.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</style>
</head>
<body>
<iframe src="about:blank" frameborder="0" scrolling="no" allow="clipboard-read; fullscreen; autoplay; geolocation"></iframe>
<iframe src="about:blank" frameborder="0" scrolling="no" allow="fullscreen; autoplay"></iframe>
<script type="text/javascript" src="assets/js/index/electron.js"></script>
<script>
process.on('warning', e => {
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
</player>
<div class="curtain curtain-a"></div>
<div class="curtain curtain-b"></div>
<iframe id="app" src="about:blank" allow="clipboard-read; fullscreen; autoplay; geolocation" scrolling="no" frameborder="0"></iframe>
<iframe id="app" src="about:blank" allow="fullscreen; autoplay" scrolling="no" frameborder="0"></iframe>
<script type="text/javascript" src="assets/js/libs/events.js"></script>
<script type="text/javascript" src="assets/js/index/index.js"></script>
<script type="text/javascript" src="node_modules/jquery/dist/jquery.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/bridge/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class BridgeServer extends Events {
response.setHeader('Access-Control-Allow-Methods', 'GET')
response.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Cache-Control, Accept, Authorization')
response.setHeader('Connection', 'close')
response.setHeader('Feature-Policy', 'clipboard-read; fullscreen; autoplay; geolocation')
response.setHeader('Feature-Policy', 'clipboard-read; fullscreen; autoplay;')
if(parsedUrl.pathname == '/upload') {
const form = formidable({ multiples: true })
form.parse(req, (err, fields, files) => {
Expand Down
42 changes: 17 additions & 25 deletions www/nodejs-project/modules/channels/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class ChannelsData extends Events {
}

class ChannelsCategories extends ChannelsData {
constructor(opts){
super(opts)
constructor(){
super()
}
loadCategories(cb){
global.storage.raw.get(this.categoriesCacheKey, data => {
Expand Down Expand Up @@ -224,23 +224,20 @@ class ChannelsCategories extends ChannelsData {
data = await this.applyMapCategories(map, data, amount, isMainCountry ? false : weighted)
}
}
const limit = pLimit(2)
const tasks = () => countries.map(country => {
return limit(async () => {
return await processCountry(country)
})
})
if(countries.length) {
await processCountry(countries[0])
if(countries.length > 1) {
const limit = pLimit(2)
const tasks = () => countries.slice(1).map(country => {
return limit(async () => {
return await processCountry(country)
})
})
await Promise.allSettled(tasks()).catch(console.error)
if(!completed()){
data = {}
weighted = false
await Promise.allSettled(tasks()).catch(console.error)
}
}
if(!completed()){
data = {}
weighted = false
await Promise.allSettled(tasks()).catch(console.error)
}
return data
}
getCategories(compact){
Expand All @@ -261,8 +258,8 @@ class ChannelsCategories extends ChannelsData {
}

class ChannelsEPG extends ChannelsCategories {
constructor(opts){
super(opts)
constructor(){
super()
this.epgStatusTimer = false
this.epgIcon = 'fas fa-th'
this.clockIcon = '<i class="fas fa-clock"></i> '
Expand Down Expand Up @@ -606,8 +603,8 @@ class ChannelsEPG extends ChannelsCategories {
}

class ChannelsEditing extends ChannelsEPG {
constructor(opts){
super(opts)
constructor(){
super()
global.ui.on('channels-import-file', data => {
console.warn('!!! IMPORT FILE !!!', data)
global.ui.importFileFromClient(data).then(ret => this.importFile(ret)).catch(err => {
Expand Down Expand Up @@ -924,13 +921,8 @@ class ChannelsKids extends ChannelsAutoWatchNow {
}

class Channels extends ChannelsKids {
constructor(opts){
constructor(){
super()
if(opts){
Object.keys(opts).forEach((k) => {
this[k] = opts[k]
})
}
}
async goChannelWebsite(name){
if(!name){
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/conn-racing/conn-racing.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ConnRacing extends Events {
}
this.results.push(result)
this.pump()
return ret.status
return status
} else {
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31234,7 +31234,7 @@ const pLimit = concurrency => {

try {
await result;
} catch {}
} catch(e) { }

next();
};
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/lang/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Language extends Events {
return this.countryCode = this.alternateCountries.shift()
}

const countriesTzAllLangs = this.hints.langs.map(l => this.getCountriesFromLanguage(l)).flat().filter(c => countriesTz.includes(c)) // country should be in tz
const countriesTzAllLangs = this.hints.langs.map(l => this.countries.getCountriesFromLanguage(l)).flat().filter(c => countriesTz.includes(c)) // country should be in tz
if(countriesTzAllLangs.length){ // language in navigator hints, right timezone
this.alternateCountries = [...new Set(countriesTzAllLangs)]
return this.countryCode = this.alternateCountries.shift()
Expand Down
6 changes: 3 additions & 3 deletions www/nodejs-project/modules/lists/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ 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.updater && this.updater.close && this.updater.close()
this.master.addList(url, 1)
}
schedule(url, priority){
Expand All @@ -176,7 +176,7 @@ 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()
this.updater && this.updater.close && 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)
Expand All @@ -203,7 +203,7 @@ class ListsLoader extends Events {
this.updater.on('progress', progressListener)
this.results[url] = 'reloading'
this.results[url] = await this.updater.updateList(url, true, progressId).catch(err => updateErr = err)
this.updater && this.updater.close()
this.updater && this.updater.close && this.updater.close()
this.updater.removeListener('progress', progressListener)
global.osd.hide('progress-'+ progressId)
if(updateErr) throw updateErr
Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-project/modules/lists/update-list-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class UpdateListIndex extends ListIndexUtils {
if(this.debug){
console.log('end')
}
this.stream.destroy()
this.stream && this.stream.destroy()
if(!resolved) {
resolved = true
reject('unknown http error')
Expand Down
4 changes: 2 additions & 2 deletions www/nodejs-project/modules/streamer/utils/ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class StreamerFFmpeg extends Events {
reject('file empty'+ t)
}
} else {
reject(oerr)
reject(oerr || aerr || '')
}
}
})
Expand Down Expand Up @@ -567,7 +567,7 @@ class StreamerFFmpeg extends Events {
})
}).catch(e => {
console.error('waitFile failed', this.timeout, e)
if(e.indexOf('timeout') != -1){
if(String(e).indexOf('timeout') != -1){
e = 'timeout'
}
reject(e)
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 @@ -45,7 +45,7 @@
"description": "A intuitive, multi-language and cross-platform IPTV player.",
"name": "megacubo",
"icon": "./default_icon.png",
"version": "17.1.1",
"version": "17.1.2",
"theme": {
"fullScreen": true
},
Expand Down

0 comments on commit 1c86ccd

Please sign in to comment.