Skip to content

Commit

Permalink
Use monitors instead of monitorData as the array to traverse. Somehow…
Browse files Browse the repository at this point in the history
… we end up with there not being an entry in monitors when there is one in monitorData. Maybe when visibility events occur during InitPage? Anyways, if we are actually traversing monitors, then we should do so in the for loop.
  • Loading branch information
Isaac Connor committed Jul 4, 2024
1 parent 4cfef05 commit 55d80d5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions web/skins/classic/views/js/montage.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ function reloadWebSite(ndx) {
}

function takeSnapshot() {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
monitors[i].kill();
}
const monitor_ids = monitorData.map((monitor)=>{
Expand Down Expand Up @@ -557,7 +557,7 @@ function handleClick(evt) {
}

function startMonitors() {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
const obj = document.getElementById('liveStream'+monitors[i].id);
if (obj.src) {
const url = new URL(obj.src);
Expand All @@ -576,7 +576,7 @@ function startMonitors() {
}

function stopMonitors() { //Not working yet.
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
//monitors[i].stop();
//monitors[i].kill();
monitors[i].streamCommand(CMD_QUIT);
Expand All @@ -585,13 +585,13 @@ function stopMonitors() { //Not working yet.
}

function pauseMonitors() {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
monitors[i].pause();
}
}

function playMonitors() {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
monitors[i].play();
}
}
Expand Down Expand Up @@ -1016,7 +1016,7 @@ function setTriggerChangedMonitors(id=null) {
}

function checkEndMonitorsPlaced() {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
const id = monitors[i].id;

if (!movableMonitorData[id].stop) {
Expand All @@ -1042,7 +1042,7 @@ function checkEndMonitorsPlaced() {
}
}
if (monitorsEndMoving) {
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
//Clean for later use
movableMonitorData[monitors[i].id] = {'width': 0, 'stop': false};
}
Expand Down Expand Up @@ -1115,14 +1115,14 @@ document.onvisibilitychange = () => {
TimerHideShow = clearTimeout(TimerHideShow);
TimerHideShow = setTimeout(function() {
//Stop monitors when closing or hiding page
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
monitors[i].kill();
}
}, 15*1000);
} else {
TimerHideShow = clearTimeout(TimerHideShow);
//Start monitors when show page
for (let i = 0, length = monitorData.length; i < length; i++) {
for (let i = 0, length = monitors.length; i < length; i++) {
if (!monitors[i].started) {
monitors[i].start();
}
Expand Down

4 comments on commit 55d80d5

@IgorA100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@connortechnology
I have a huge request. Don't make many code changes to the Montage page for now. So that double work does not occur and nothing is lost later.
You did everything right here, but I also made these changes myself.
Montage page is undergoing very, very strong changes in the code.
I hope to be able to publish a beta version of the code in 1-2 weeks.

@IgorA100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, you can completely ignore Montage page errors.
Well, or write to me in the appropriate topic. Perhaps I have already corrected something myself.
There is still a lot of testing of the combined Montage page & Montage review page...

@connortechnology
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO!!!

You do NOT get to work in a cathedral and have us all bend to your needs. We run this code IN PRODUCTION. When a problem is found it will be fixed. I will NOT stop mine or anyone else's development efforts to wait for you.

I make no promises about merging your code in a timely manner, because I make promises to the paying customers about stability.

Put your work into a new view. It can get merged quicker in an experimental option that does not affect existing use.

@IgorA100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, Isaac.
I wrote something stupid.
Of course I don’t want you to adapt to me.

Please sign in to comment.