INTERACT FORUM

Please login or register.

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

Author Topic: Expression question, how to get album names from an artist stack into var  (Read 3134 times)

EddyBE

  • Member
  • *
  • Posts: 3

Hi,
I've made an expression to change the [Album] color under a thumbnail to green when in the album string has my magic substring -24] . All my hires album names are ending with e.g. [96-24]. But because it is on the end of the string, most of the time it can't be seen in thumbnail view. So I've made the whole string in green.
Is there a way to do this in artist view when there is a stack of albums? What I want to do is to color the 'Name' under the stack green when there is 1 or more albums in hires. Tried the album var, but it returns 'varies' and no luck with Group function.
Thanks!
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression question, how to get album names from an artist stack into var
« Reply #1 on: February 15, 2016, 01:45:20 am »

hopefully someone has an easier way...

but you may need to use a variable, which calculates the average bitrate of all the albums under an artist, which if then is above 16 you can safely assume one album at 24...i'm unaware of a better method to calculate anything over a bunch of files that span any fields (like albums under artist, or tracks under multiple albums, etc.)

http://wiki.jriver.com/index.php/Global_Variables

i have no means of testing this right now...but it will get you on the right track that much i know.  basically it should average the bit depth over all tracks under one album artist (auto).  you could then put this into a custom field (once it's working) and then use the results of that field to set your colour change criteria

good luck, i can try and help with it if it doesn't work out of the box but i'm away from a testing platform for a while.  the following code was designed to be put into a smartlist FYI as i find it the easiest way to get variables working globally

Code: [Select]
[=save(0,var_number_of_tracks[album artist (auto)])1]=1 [=save(0,var_avgbitdepth[album artist (auto)])1]=1 [=save(math(1+load(var_number_of_tracks[album artist (auto)])),var_number_of_tracks[album artist (auto)])1]=1 [=save(math([bit depth]+load(var_avgbitdepth[album artist (auto)])),var_avgbitdepth[album artist (auto)])1]=1 [=save(math(load(var_avgbitdepth[album artist (auto)]) / load(var_number_of_tracks[album artist (auto)])),var_artist_bitdepth[album artist (auto)])1]=1 [Media Type]=[Audio] ~sort=[Media Type],[Album Artist (auto)],[Album],[Disc #],[Track #],[Name]
Logged

EddyBE

  • Member
  • *
  • Posts: 3
Re: Expression question, how to get album names from an artist stack into var
« Reply #2 on: February 15, 2016, 02:54:07 am »

Thanks Ferday,
All my hires albums have an 'album' tag like this: e.g.: I Robot [192-24] So I don't need to do a calculation, I have tagged it all ready when it was added to the library. Even the album folder has this -24] substring. So, the question is, how do I get all the album names which are stacked under an artist? (With your proposal, I also need to find out which albums there are in the artist stack.)
This expression I use for an artist with only 1 album (or after entering an artist stack):
Code: [Select]
[Album Artist (auto)]
if(isequal([Album], -24], 8), <font color="0000FF">[Album] <//font>,<font color="000000">[Album] <//font>)
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression question, how to get album names from an artist stack into var
« Reply #3 on: February 15, 2016, 03:26:02 am »

There's the problem though

Because MC only treats files (usually a track is a file) you need variables to lump tracks together, whether it's across separate albums or genres etc. There is no "if any" in the expression language

im not sure how to make it work, but maybe you could build a list with artist-album, then search that list for "24"

I still think you're stuck with variables :(
Some of us have been asking for some time to make an album key (like each file has a key) which would make a lot of these types of things easier, but variables do work they are just confusing

One way that's easy (but time consuming) is to make a custom artist-24 field and manually enter something if you have an HD album from that artist.  But that doesn't seem as fun than an automagic method

Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression question, how to get album names from an artist stack into var
« Reply #4 on: February 16, 2016, 03:40:11 am »

im not totally sure what you want.. but i guess there is a way to do that..
under the album artist thumbnail you get var because when there are more albums the value varies.
to get around this you could use numbers, because under a thumbnail mc will write the average (not for all values, some are treated different).
now you could make a new library field, give it a name (like CalcHires) and make it a calculated field. as the expression for the field use something like this
Code: [Select]
if(isequal([Album], -24], 8), 100, 1)&datatype=[integer]
now test by putting  [CalcHires] under the thumbnail..
it schould 1 when there is no hires album under an artist and something else when there is.

now under the thumbnail use
Code: [Select]
if(isequal([CalcHires], 1, 5), <font color="0000FF">[Album Artist (auto)] <//font>,<font color="000000">[Album Artist (auto)] <//font>)
i did not test this totally, because i dont tag my files that way.. just thought it could work..

 :)
gab

edit: changed it a bit, because 0 is not always working well, and i made it the wrong way around... hope this does it.. :)
Logged

EddyBE

  • Member
  • *
  • Posts: 3
Re: Expression question, how to get album names from an artist stack into var
« Reply #5 on: February 17, 2016, 06:54:04 am »

Thanks Gappie!
Tried it, and works great.  :)
Did not know it was possible to create library fields outside the filetags.
Now I can see if a stack of albums has one or more hires albums in it without entering the stack.

Eddy
Logged
Pages: [1]   Go Up