INTERACT FORUM

Please login or register.

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

Author Topic: Syncing "Number of Views" between 2 machines using Client/Server Issue  (Read 605 times)

eltigre15

  • Recent member
  • *
  • Posts: 8

I have been playing around for the past few hours trying to get 2 different machines running JRiver to combine views counts so if I watch a show on one machine it saves on the other.  There seems to be 2 options:

1)  House the library on the NAS and have both computers point but then the second computer becomes read only so it won't be able to log the views.
2)  Set up a Client/Server model but when I do this the computers for the client and server are on at different times so the client won't load the library if the server isn't on.

Is there a way of the Client/Server model housing a server copy inside the same library on the client when the server is offline so I don't have to manually change libraries?  Are there any other ways to synchronize the views (I tried to sync two local libraries across the network and it looked like it was doing something for an hour but at the end they both looked the same as before the sync)?  Any help would be appreciated.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Syncing "Number of Views" between 2 machines using Client/Server Issue
« Reply #1 on: August 19, 2019, 07:54:13 pm »

First, definitions, just to be sure:
In MC the Library is the set of index files storing information about the media files you own. It is associated with one MC installation.
The actual audio, video, etc. files are media files, and can be stored locally, on USB drives, on a NAS, or anywhere accessible to Windows (in this case) and hence MC.

The Library should always be on a fast local hard disk, preferably an SSD, so that you get fast response from MC.
The Library should never be placed on a NAS. Ever. There be dragons.

MC was doing the only correct thing it could do in your situation 1) above. If it didn't do that you would have corrupted the Library, which is basically a flat-file database and does not support multiple concurrent users.
JRiver's Client/Server model, and in fact any server model, requires that the server by up and running when you use the Client. Simple. Set it up to wake when the Client accesses it, using WOL. MC sends WOL Magic Packets automatically when a Client tries to connect to the Server using the JRiver Access Key method.

You can set which Library is loaded at MC startup. So no need to change Libraries. Just have the Client always open the Server Library, and wake the Server if necessary.
Have you ben trying to use the function under "File > Library > Sync Library"? Don't use that. It is intended to sync all media files and the Library between two PCs, so that they are set up identically. It isn't perfect. It is old functionality. I don't recommend it.

Use the Client/Server configuration. Set up Authentication with a Username and Password, which will enable the [Number Plays] field to be synced from the Client to the Server. Don't use Read-Only Authentication. Note that each time a Client connects to a Server, it receives a complete copy of the Server Library, including the latest information in the [Number Plays] field. Any changes made in that copy are then periodically synced to the Server Library, when using Authentication.

Read more Wiki and Forum threads.
https://wiki.jriver.com/index.php/Media_Network
https://wiki.jriver.com/index.php/Media_Server
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

eltigre15

  • Recent member
  • *
  • Posts: 8
Re: Syncing "Number of Views" between 2 machines using Client/Server Issue
« Reply #2 on: August 19, 2019, 08:21:34 pm »

Thanks for the response.  Yes, I did read those items on the wiki but for my own reasons I don't want the server to be woken up when the client wants to connect.  If there is a way to consolidate the number plays, even if its manually or a pain, while keeping each computer separate to communicate with the NAS data files without relying on them both being powered on it would be a big help to me.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Syncing "Number of Views" between 2 machines using Client/Server Issue
« Reply #3 on: August 19, 2019, 09:12:01 pm »

Well, that depends a little bit on your specific Use case. i.e. Whether only one PC is ever using MC at a time. Whether the now two independent Libraries that you are running on each PC need to be the same. Etc.

Some people use a primary PC, backup the Library on it, and Restore the Library to a secondary PC. Sometimes with, sometimes without settings. MC on the two PCs needs to be pretty much set up identically, with drive letters or references to a NAS identical, for example, so that MC can find the media files. That can work well for some, and you might be able to find descriptions of how people have set it up. There is one thread that goes through the details, if I remember correctly. Although that may have included syncing media files.

There are also some utilities around that can update data in MC. Swag of tools and MCUtils comes to mind.

But if you running two independent Libraries, the easiest way to just manage the [Number Plays] in each is to write that field to a file tag whenever it changes.

Go to "Options > Library & Folders > Manage Library Fields > select [Number Plays] > tick the checkbox 'Save in files tags (when Possible)'"
Then "Options > General > Importing & Tagging > tick 'Update tags when file info changes'", which will write tags to the files whenever a field value in the MC Library changes. i.e. When [Number Plays] is changed.
It would be a good idea to always have Auto Import running as well. "Options > Library & Folders > Auto-Import > tick the checkbox 'Run auto-import in the bakground'" so that the other library picks up changes.
Check your settings for Auto Import carefully as well. "Options > Library & Folders > Auto-Import > Configure auto-import", tick the checkbox "Update for external changes".

I think that will do it for you.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

eltigre15

  • Recent member
  • *
  • Posts: 8
Re: Syncing "Number of Views" between 2 machines using Client/Server Issue
« Reply #4 on: August 21, 2019, 04:10:07 pm »

That was exactly the type of fix that I was looking for.  I followed the steps on both computers and when you play a video it now updates a field in the .xml file that shows number plays which is great.  The problem is I gave it almost 24 hours and the other computer never updated the tagging information on the file in its own local library.  I double checked my settings for all of the auto importing functionality so I'm at a loss why it's not picking it up.  I really appreciate the indepth help.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Syncing "Number of Views" between 2 machines using Client/Server Issue
« Reply #5 on: August 21, 2019, 06:18:31 pm »

Ah, this is for video files. I must admit that I was thinking audio files even though you said it was the "views counts" that you wanted shared.

The above process would work for [Number Plays] for audio files because the tags are stored in the audio files themselves. Hence, there is a "File System Event" for those files, and the "Date modified" changes in Windows, so Auto Import notices and updates the second Library.

Note that if your NAS (where the media files are stored) supports "File System Events" then Auto Import on the second Library should pick up the tag changes almost as soon as you launch MC. If your NAS doesn't support "File System Events", and it reports to MC that it doesn't, then MC will run Auto Import on a regular basis and will pick up the changes when Auto Import happens. "Regular" is a bit of an unknown quantity, but let's say 10 minutes. It should probably run when you launch MC, but I haven't checked if it does. I think Awesome Donkey documented somewhere how often it happens. So, no need to wait any significant length of time for the tags to update. You could also normally just run Auto Update manually and it should pick up any changes. The exception is where your NAS tells MC that it supports "File System Events" but actually doesn't, in which case MC will never run Auto Import. But all that is just background info.

You are talking about video files, so the [Number Plays] tag is being saved in the *JRSidecar.xml file. I was expecting MC to monitor changes of that file as well, but I did some testing and apparently, it doesn't.

If you run "Update Library (from tags)" for the video files the *JRSidecar.xml gets read and the [Number Plays] field is updated in the second Library. But that is no solution because you would have to run that function for every video file every time you launched MC on either PC, in case someone had watched some videos on the other PC.

I guess this is why the MC Client/Server approach is better. The [Bookmark] field falls into the same category. Using Client/Server you can partially watch a video on one PC, stop playback, then when you start playback on another PC it will resume from where you left off, as long as settings are correct and syncing with authentication is working.


A solution for you? Maybe JRiver will consider including changes to the *JRSidecar.xml as a trigger to running Auto Import on a file and updating fields in the Library based on changes to file tags. I think that has been discussed before, but there was an issue because *JRSidecar.xml files aren't actually imported into MC as media files, so they aren't monitored. But I'm not sure my memory of that is accurate. You might find such a discussion with a forum search.

I'm afraid I can't think of any better solution than the above; running "Update Library (from tags)" manually for all video files, at every launch. It might be possible to automate that, but it isn't a good solution. Otherwise, you will have to hope JRiver will consider adding the functionality to pick up these changes.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner
Pages: [1]   Go Up