Skip to content
Snippets Groups Projects
Commit f5f9807f authored by lowercasedonkey's avatar lowercasedonkey
Browse files

FCTV init fix

parent 552f3d47
No related branches found
No related tags found
1 merge request!7295FCTV init fix
...@@ -17,6 +17,7 @@ weekEnabled - The week FCTV was installed. ...@@ -17,6 +17,7 @@ weekEnabled - The week FCTV was installed.
globalThis.FCTV = (function() { globalThis.FCTV = (function() {
return { return {
channels: channels, channels: channels,
initChannels: initChannels,
showChannel: showChannel, showChannel: showChannel,
incrementChannel: incrementChannel, incrementChannel: incrementChannel,
incrementShow: incrementShow, incrementShow: incrementShow,
...@@ -29,6 +30,13 @@ globalThis.FCTV = (function() { ...@@ -29,6 +30,13 @@ globalThis.FCTV = (function() {
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
} }
function initChannels() {
const channelList = FCTV.channels();
for (let i = 0; i < channelList.length; i++) {
V.FCTV.channel[num(channelList[i], true)] = 0;
}
}
function showChannel(i) { function showChannel(i) {
let x = { let x = {
canSelect: 1, canSelect: 1,
......
...@@ -5,15 +5,6 @@ App.Update.FCTV = function() { ...@@ -5,15 +5,6 @@ App.Update.FCTV = function() {
return V.FCTVreceiver ? a : b; return V.FCTVreceiver ? a : b;
} }
function initChannels() {
const channelList = FCTV.channels();
for (let i = 0; i < channelList.length; i++) {
const channel = num(channelList[i], true);
const currentChannel = 'show' + capFirstChar(channel);
V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0;
}
}
V.FCTV = V.FCTV || {}; V.FCTV = V.FCTV || {};
V.FCTV.receiver = V.FCTV.receiver > -1 ? V.FCTV.receiver : -1; V.FCTV.receiver = V.FCTV.receiver > -1 ? V.FCTV.receiver : -1;
if (convert && V.receiverAvailable) { if (convert && V.receiverAvailable) {
...@@ -21,7 +12,7 @@ App.Update.FCTV = function() { ...@@ -21,7 +12,7 @@ App.Update.FCTV = function() {
} }
V.FCTV.pcViewership = V.FCTV.pcViewership || {}; V.FCTV.pcViewership = V.FCTV.pcViewership || {};
V.FCTV.channel = V.FCTV.channel || {}; V.FCTV.channel = V.FCTV.channel || {};
initChannels(); channelsBC();
V.FCTV.channel.last = convert(V.lastShow, V.FCTV.channel.last) || -1; V.FCTV.channel.last = convert(V.lastShow, V.FCTV.channel.last) || -1;
V.FCTV.pcViewership.count = convert(V.FCTVcount, V.FCTV.pcViewership.count) || 0; V.FCTV.pcViewership.count = convert(V.FCTVcount, V.FCTV.pcViewership.count) || 0;
...@@ -31,4 +22,12 @@ App.Update.FCTV = function() { ...@@ -31,4 +22,12 @@ App.Update.FCTV = function() {
if (V.FCTVreceiver && !V.FCTV.weekEnabled) { if (V.FCTVreceiver && !V.FCTV.weekEnabled) {
V.FCTV.weekEnabled = V.receiverAvailable > 1 ? V.receiverAvailable : 0; V.FCTV.weekEnabled = V.receiverAvailable > 1 ? V.receiverAvailable : 0;
} }
function channelsBC() {
const channelList = FCTV.channels();
for (let i = 0; i < channelList.length; i++) {
const channel = num(channelList[i], true);
V.FCTV.channel[channel] = V.FCTV.channel[channel] || 0;
}
}
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment