INTERACT FORUM

Please login or register.

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

Author Topic: Relational fields cleared  (Read 2551 times)

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Relational fields cleared
« on: August 24, 2013, 08:30:33 am »

I have fields Opus, Work set as relational to Series

The moment I populate the series field for the first time all the data for work, opus is cleared for the first tracks with identical keys in the album.
Undo won’t help
What can be the cause of this?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Releational fields cleared
« Reply #1 on: August 24, 2013, 08:40:31 am »

When you join a relational group, you'll inherit the values of the other files in the group.

Is it possible there was another series in the library with the same value but empty work and opus?
Logged
Matt Ashland, JRiver Media Center

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Releational fields cleared
« Reply #2 on: August 24, 2013, 08:53:54 am »

I selected all of this composer.
None of them has Series populated (I do think it is related to the first time)
All fields (work, opus) are populated
I use an expression to bulk populate Series
=ListItem([composer],0,/,)If(IsEmpty([Opus]),_[Work],_[Opus])
I get something like Clementi_Op.1

As you can see in the screen shot, it is systematical.
I had 8 albums and in each case the first tracks of each album with identical keys are cleared.
As this repeated itself 8 times it probably has something to do with being the first in an album.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Releational fields cleared
« Reply #3 on: August 24, 2013, 08:58:43 am »

Would you be willing to mail me a library backup (matt [at] jriver (dot) com) that shows the problems along with step-by-steps to reproduce what you think is the problem?

Thanks.
Logged
Matt Ashland, JRiver Media Center

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Releational fields cleared
« Reply #4 on: August 24, 2013, 09:06:18 am »

Will do

Thanks
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Releational fields cleared
« Reply #5 on: August 29, 2013, 11:22:22 am »

It seems to me like you're making a circular reference.

Opus and Work are relational to Series.

Then you're setting Series from the Opus and Work.

But when you change the Series, it's going to change the Opus and Work.  If you enter a new Series value, the existing values in Opus and Work define the relationship.  If you enter an existing Series value, you'll inherit the most common Opus and Work values from the other files already in the relationship.

This is a circle, and the behavior is undetermined.  I don't see a way around it (punny!).
Logged
Matt Ashland, JRiver Media Center

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Releational fields cleared
« Reply #6 on: August 29, 2013, 12:43:24 pm »

A bit unclear to me.

If one populates Series of a track, the app looks into the database
If it find values for the relational fields, these values are used to populate the relational fields.
If the app don’t find them, it leaves current values untouched in any relational tag.
This is the normal behavior

I don’t see any circular pattern.

Can you explain why only the first tracks of each album with a common Series have their relational fields cleared and the other tracks not?
If it was circular, I expect it to apply to all tracks, not to only the first of each album.
Might it be that when a new album is found, something is initialized the wrong way?

I repeated all the steps I send you.
This time everything is populated, including the first tracks of each album.
Looks like something very erratic is going on.
Can it be related to the first time a new value for series is created?

Thanks

Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Releational fields cleared
« Reply #7 on: August 29, 2013, 01:12:52 pm »

In your original thread I suggested you had a loop:

   http://yabb.jriver.com/interact/index.php?topic=77960.msg529570#msg529570

   So Opus and Work are Series relational, but Series relies on Opus and Work?  That seems like a loop.

You can't assume an order to when the clearing of values and the setting of values occurs.  When you set your series with:

   =ListItem([composer],0,/,)If(IsEmpty([Opus]),_[Work],_[Opus])

MC has to iterate over the files internally, one at a time, and assign Series with the calculation.  Your mental model is that MC works serially:

   1. Clear out old Series values
   2. Compute expression value for Series
   3. Assign this value to Series
   4. Update Opus and Work to be based on the new relationship now formed with the new value of Series

But in a multi-threaded system, it could be that MC:

   1. starts a thread to clear out / or set Series values to break the current relationship between Opus and Series and Work and Series (since Series is changing).

   2. starts a thread to populate the Series values from the calculation

   3. starts a thread to copy the Opus and Work values from one track to another track based on the new relationship.

If thread (1) clears just a couple Series values and then thread (3) kicks in and notices the new relationship is formed based on a Series values of EMPTY, then MC might go about updating all the Work and Opus fields that relate to the EMPTY Series value.

If there is no guarantee of order, this is a classic race condition where the results are undefined.
Logged
The opinions I express represent my own folly.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42387
  • Shoes gone again!
Re: Releational fields cleared
« Reply #8 on: August 29, 2013, 01:27:51 pm »

My head hurts thinking about this. 

But let's try to distill down what's happening.  Nevermind, MrC beat me to it.  Thanks MrC.

What you're asking for is complicated.  We might be able to make MC handle this type of circular reference better, but it seems cleaner to pick a data model that doesn't circle in on itself.
Logged
Matt Ashland, JRiver Media Center

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Releational fields cleared
« Reply #9 on: August 29, 2013, 02:35:02 pm »

Quote
If thread (1) clears just a couple Series values and then thread (3) kicks in and notices the new relationship is formed based on a Series values of EMPTY, then MC might go about updating all the Work and Opus fields that relate to the EMPTY Series value.

Brilliant

However, I would be highly surprised if Series=Empty is used as a value.
If this would be true I expect all too be cleared.

Nowhere in my data the fields Opus or Work are empty
Expressions don’t clear the fields used in the expression except of course the output field.
What I have experienced up to know is it is always the first tracks in the album.

To avoid losing data each time I have a second field Catalog (and likewise Composition)
This is an exact copy of opus except of course it is not relational otherwise JRiver will destroy it too.
I can do the same using Catalog instead of Opus in the expression and I do get the same results.

http://yabb.jriver.com/interact/index.php?topic=77960.0

Makes me wonder if this has anything to do with using relational fields in formulas.

Quote
My head hurts thinking about this.

I kindly invite you to hurt it a little bit more.
Logged

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Releational fields cleared
« Reply #10 on: August 30, 2013, 04:13:34 pm »

Another experiment
This time I typed =Purcell_[MCHI_Opus] in series
MCHI_Opus is not relational to Series

Again the first and only the first line is cleared.
Logged
Pages: [1]   Go Up