INTERACT FORUM

Please login or register.

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

Author Topic: FileKey Duplicate?  (Read 526 times)

eve

  • Citizen of the Universe
  • *****
  • Posts: 651
FileKey Duplicate?
« on: September 05, 2023, 06:49:38 pm »

How does FileKey assignment work for items not in JRiver's library? It seems to 'increment', which is fine. However I've run into an issue where my last 2 played items have had the same FileKey . To explain, I watched something last night and then exited JRiver. I opened it up today, with an empty playback queue and then added a file to the playback queue (a different file than last night), the FileKey (reported by MCWS/v1/Playback/Info?Zone=-1)  is the number as the one last night.

I was using FileKey as an identifier for the currently playing item (so that I'd only go ask for the 'full' item metadata, if it changes) but if it's not consistently unique that's going to present a problem. I *guess* I can take FileKey and DurationMS, hash those and get a more stable unique id?
Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 651
Re: FileKey Duplicate?
« Reply #1 on: September 05, 2023, 07:25:43 pm »

To explain what I'm doing right now.
I just poll MCWS/v1/Playback/Info?Zone=-1 (well, not always -1 but for this example it's sufficient), every 5s. That data goes into redis and the formatted data gets sent out via websocket. To actually get what's playing, when the 'filekey' changes, I ask for the full data. This gives me the proper stream info (so that I can control audio and subs), and the IMDb ID so I can reference it back to my main metadata server and get more comprehensive metadata about the item's global identity.

Redis acts as the database here, cutting down on the need to poll JRiver (no control / client device actually needs to ask jriver for state), and taking care of playback history (which influences my recommendations).

Obviously, if there's the possibility of a duplicate filekey, I'll have to come up with a new stable id (There's very little chance of FileKey+DurationMS having a collision right?)



Logged
Pages: [1]   Go Up