INTERACT FORUM

Please login or register.

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

Author Topic: Expression for Validating Relations  (Read 1947 times)

joh

  • World Citizen
  • ***
  • Posts: 100
Expression for Validating Relations
« on: April 20, 2010, 03:38:41 pm »

Hi

Some library fields are logically determined by the value of another field - e.g. Composer_Birth_Year is a function of Composer, Album_Release_Year is a function of Artist + Album.

I would like to have some help with checking where I have inconsistent data - e.g. multiple library items having an identical value for "composer" have different (incl <empty>) values in the "Composer_Birth_Year") field.

Is it possible to write an expression that returns a list of all set of library items where one value in a certain field is associated with different values in another field?

Thanks in advance!

Olle
Logged

zxsix

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1753
Re: Expression for Validating Relations
« Reply #1 on: April 20, 2010, 03:42:49 pm »

I'm gonna jump on board here for a reply also.   I'm not so good with expressions yet, but I'm looking for a way to identify artists that may be tagged with multiple genres.  I think a proper answer will lead to solving both needs.
Logged

bunglemebaby

  • Galactic Citizen
  • ****
  • Posts: 469
Re: Expression for Validating Relations
« Reply #2 on: April 20, 2010, 09:27:49 pm »

The closest thing that I know of is using a combination of ~dup and ~nodup, like so:
Code: [Select]
~dup=[Artist] ~nodup=[Genre]Unfortunately what this will return is actually a list of the artists that have multiple genres associated with them, but it only lists one file for each artist. But, from here you can at least use the "Locate Artist" right-click command or arrow-button to go and find the offending files.

Other smarter folks might be able to help you refine that to make it better, but that might also be all you can get currently. Also, I believe the Auto-Tagger plugin that confishy is developing will be able to do this sort of thing (or can now?).
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression for Validating Relations
« Reply #3 on: April 21, 2010, 01:37:27 am »

The problem with these is that we can only use expressions to compare fields associated with a given file. We cannot compare a field from one file with a field from another.

This means that we must resort to using smartlists and exclusions to get as close as possible, then do the rest the hard way.

The closest thing that I know of is using a combination of ~dup and ~nodup, like so:
Code: [Select]
~dup=[Artist] ~nodup=[Genre]Unfortunately what this will return is actually a list of the artists that have multiple genres associated with them, but it only lists one file for each artist. But, from here you can at least use the "Locate Artist" right-click command or arrow-button to go and find the offending files.
You are correct that the solution to this problem cannot be realised using expressions. What you're search will actually return there, is one example of every genre that exists in the library.
What you want is: [media type]=[audio] ~nodup=[artist],[genre] ~sort=[artist] which will leave one example of each "[artist]/[genre]" combination, including empty genres, that exist in the library. From there, clicking on the 'linkable columns' arrow to get at the full list of artist tracks, as you described, is quick and easy.

joh, this same logic fits for you, simply adjust the library fields in the search rule to fit your needs.

regards,
-marko.

bunglemebaby

  • Galactic Citizen
  • ****
  • Posts: 469
Re: Expression for Validating Relations
« Reply #4 on: April 21, 2010, 06:43:13 am »

You are correct that the solution to this problem cannot be realised using expressions. What you're search will actually return there, is one example of every genre that exists in the library.
Oops, I guess I should have checked those results a little bit closer...thanks for clearing that up marko.
Logged

joh

  • World Citizen
  • ***
  • Posts: 100
Re: Expression for Validating Relations
« Reply #5 on: April 21, 2010, 12:10:39 pm »

Thanks Gents for the support. I realize that Marco has helped me solve another problem using the same method. Sorry for not recalling it... I have seen that there is a utility (SQLMyTunes for MC) that allows export / import of the MC Library to a sql database in order to make updates like the one I asked for more efficiently - have you tried it out, Marco?

Thanks,
Olle
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression for Validating Relations
« Reply #6 on: April 21, 2010, 12:49:38 pm »

I haven't, no. I have absolutely zero experience of working with sql databases, so for me, it would be unlikely to be more efficient!!

-marko.
Pages: [1]   Go Up