INTERACT FORUM

Please login or register.

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

Author Topic: Expression help for finding Artists with 2 types of media  (Read 1377 times)

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Expression help for finding Artists with 2 types of media
« on: September 19, 2014, 08:10:44 pm »

Since the expression language is file based I am having a hard time wrapping my brain around this one. I would like to compose an expression that will show only Artists that have both Audio files and video files.

Everything I try will filter on the first Media type AUDIO and exclude any VIDEO type.

Looking for an expression that says: show only artists that have Audio files and Video files. (Video files are tagged with Artist field)

Any tips?

Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Expression help for finding Artists with 2 types of media
« Reply #1 on: September 20, 2014, 02:54:03 am »

What you want to do is create a result set from a seed list.  This was not possible before variables.  I figured out a solution but  nobody, it seems, needed it until now...

I base this comment on the ZERO replies to my HOWTO http://yabb.jriver.com/interact/index.php?topic=90504.0  :o

Anyway, here you go, this seems to get close to what you need.

(([Media Type]=[audio],[Video] [=save(0,v_filter[artist],0)]=0) or ([Media Type]=[Video] -[Artist]=[] [=save(1,v_filter[artist],1)]=1) or ([Media Type]=[Audio] [=load(v_filter[artist])]=1)) ~sort=[Artist]

Steps:

Set an artist flag to 0 for every AUDIO/VIDEO file in the library.
Create a SEED list by setting the artist flag to 1 for all video files (as long as the artist field is non-empty)
Filter against all AUDIO artists that match the flag.

Logged

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: Expression help for finding Artists with 2 types of media
« Reply #2 on: September 20, 2014, 09:44:21 am »

Wow!! Just great, thanks. I had read your post on seeding a few times, but could not implement it. I'm going to study this one a bit.

Works well, and I think I will be able to tweak it a bit to get the exact results I want.

Thanks for your time,

Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Expression help for finding Artists with 2 types of media
« Reply #3 on: September 20, 2014, 10:12:07 am »

Happy to help.

There's a few things going on here: variables and OR/AND blocks.  The expression feels more complicated than it really is and once you "get it" it's obvious.
Logged

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: Expression help for finding Artists with 2 types of media
« Reply #4 on: September 20, 2014, 10:18:56 am »

Only one thing I saw was if a video had an Artist and that Artist did not have any audio files it would still show just the Video file. I worked around that, a couple Artists were misspelled on the video files :-[, and I have the artist field populated with the series name for my TV shows. Fixing the spelling and omitting Tv shows fixed the display of files.

Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)
Pages: [1]   Go Up