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

tweaks to bc

parent 5c5054b2
No related branches found
No related tags found
No related merge requests found
...@@ -3,30 +3,27 @@ App.Update.FCTV = function() { ...@@ -3,30 +3,27 @@ App.Update.FCTV = function() {
function convert(a, b) { function convert(a, b) {
return V.FCTVreceiver ? a : b; return V.FCTVreceiver ? a : b;
} }
delete V.FCTVenable; 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) {
V.FCTV.receiver = V.FCTVreceiver > 0 ? V.FCTVreceiver : 0; V.FCTV.receiver = V.FCTVreceiver > 0 ? V.FCTVreceiver : 0;
} }
if (V.FCTV.receiver > -1) { V.FCTV.channel = V.FCTV.channel || {};
V.FCTV.channel = V.FCTV.channel || {}; V.FCTV.pcViewership = V.FCTV.pcViewership || {};
V.FCTV.pcViewership = V.FCTV.pcViewership || {}; const channelList = FCTV.channels();
for (let i = 0; i < channelList.length; i++) {
for (let i = 0; i < channels().length; i++) { const channel = num(channelList[i], true);
let channel = num(channels()[i], true); const currentChannel = 'show' + capFirstChar(channel);
let currentChannel = 'show' + capFirstChar(channel); V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0;
V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0; }
} 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;
V.FCTV.pcViewership.frequency = convert(V.FCTVrate, V.FCTV.pcViewership.frequency) || 4; V.FCTV.pcViewership.frequency = convert(V.FCTVrate, V.FCTV.pcViewership.frequency) || 4;
V.FCTV.remote = convert(V.FCTVremote, V.FCTV.remote) || 0; V.FCTV.remote = convert(V.FCTVremote, V.FCTV.remote) || 0;
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;
}
} }
}; };
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