INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS: How do you actually make local changes permanent for a remote library?  (Read 472 times)

masterjoe

  • World Citizen
  • ***
  • Posts: 243

Hi there,

I have an automation running which allows me to change library file properties based on the current selection in theatre view.
Actually I am changing a custom library field to "1" (true) or "0" (false) with automation actions. The automation uses MCWS commands to read / update the file's custom library field.

There are two PCs each running a MC instance that are connected to my LAN. These PCs access a virtual MC instance on a Synology NAS that is running as docker container.
See the attached image for clarification.

The PCs are actually connected to the remote library running on the Synology server via LAN. All machines are on the same network.
As the automation must change file properties (the custom library field) I have enabled the media network and authentication on the server and both PCs.

When I change the file field on one PC it all works fine and the effect is visible. Until the point when I restart the machine. When the machine is restarted then all changes that the automation has done are gone! This may happen due to the fact that the library is downloaded each time I start MC and so all changes were lost because they were done locally and not on the server.

I found out there is a MCWS command to merge local changes with the library server. Something like:
http://localhost:52199/MCWS/v1/Library/Merge

I call this command with NO parameters. However even when I call this command every time after I have changed a field for a file key - it does not really sync these changes to the library server and each time I restart the PC all changes are lost. Also it seems that this command (merge) is pretty heavyweight. I only want to do tiny updates for the (minimal) changes I do.

So it seems I am missing something here?

How can I synchronize every (custom field) change I do on a PC with the library server in an efficient way?
It should be fast, reliable and easy to do.

Thanks.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2805

You should send the MCWS commands to the server, not to the local PC.

It sounds like your clients are not using authentication to connect to the server, so they are in read-only mode; all changes are lost on restart. Check if Authentication is enabled on the server and make sure the clients are connecting with the user/pass you defined.

If you don't want to enable authentication you could send the MCWS command to both the server and local client.
Logged

masterjoe

  • World Citizen
  • ***
  • Posts: 243

You should send the MCWS commands to the server, not to the local PC.

It sounds like your clients are not using authentication to connect to the server, so they are in read-only mode; all changes are lost on restart. Check if Authentication is enabled on the server and make sure the clients are connecting with the user/pass you defined.

If you don't want to enable authentication you could send the MCWS command to both the server and local client.

Thanks for answering.
I have authentication activated on the server! It's also active on the local machines.

Q1: When I send the changes ONLY to the server - will the changes also be visible immediately on the local PC?

Q2: How do I ensure that I have write-access on the server?
I thought it would be enough to use user/pass authentication on the server - which I use. And then a user/pass popup required me once on the PC to authenticate.

Q3: What is the most effective way in your opinion for multiple single field changes?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2805

Q1: When I send the changes ONLY to the server - will the changes also be visible immediately on the local PC?
Not immediately I think. You can perhaps send that /Merge command to localhost after updating the server to force an update, but I wouldn't do it too frequently.

Quote
Q2: How do I ensure that I have write-access on the server?
I thought it would be enough to use user/pass authentication on the server - which I use. And then a user/pass popup required me once on the PC to authenticate.
MC has the bad habit of trying to connect as Guest first, so it may be doing that. There's no easy way to tell, but the fact that changes are not saved is a good indication. Try changing the Guest password on the server and then restart the clients to see if it asks for user/password.

Quote
Q3: What is the most effective way in your opinion for multiple single field changes?
MCWS to the server is the way to go. The clients re-sync themselves once or twice per minute, is that not enough?
Logged

masterjoe

  • World Citizen
  • ***
  • Posts: 243

Not immediately I think. You can perhaps send that /Merge command to localhost after updating the server to force an update, but I wouldn't do it too frequently.
MC has the bad habit of trying to connect as Guest first, so it may be doing that. There's no easy way to tell, but the fact that changes are not saved is a good indication. Try changing the Guest password on the server and then restart the clients to see if it asks for user/password.
MCWS to the server is the way to go. The clients re-sync themselves once or twice per minute, is that not enough?

Thanks again.

Well, the field is used to make the corresponding files to be part (or not) of a special view in theater view.
If this field is not immediately applied then the local version will not display correctly.

So sending it to both the client and the server might help maybe.
I am also checking this field every time when you have highlighted ANY file in ANY view in theater view. So changes must be applied immediately or the overlay display that I render on top of MC would not be correct.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4363

Expecting MC to sync it's database in real-time seems a bit much, there's no evidence it's designed to support such behaviour. Do you actually need that? Ie expect changes on one machine to be visibility asap on another machine or is it really just a problem of local changes not being synced on shutdown for some reason? Why do you even need to persist that if it's just to show what you have selected? ie after you restart MC then, by definition, your UI selection has changed
Logged
Pages: [1]   Go Up